From 48f9b2c40f1127fb5003ff48d30a4a71318f41b1 Mon Sep 17 00:00:00 2001 From: Elvyria Date: Fri, 11 Oct 2024 18:46:13 +0300 Subject: [PATCH] src: hide mouse pointer if fully dimmed --- src/dim.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/dim.rs b/src/dim.rs index 2d0193b..87a211d 100644 --- a/src/dim.rs +++ b/src/dim.rs @@ -426,12 +426,17 @@ impl PointerHandler for DimData { &mut self, _conn: &smithay_client_toolkit::reexports::client::Connection, _qh: &QueueHandle, - _pointer: &wl_pointer::WlPointer, + pointer: &wl_pointer::WlPointer, events: &[PointerEvent], ) { for e in events { match e.kind { - PointerEventKind::Enter { .. } | PointerEventKind::Leave { .. } => (), + PointerEventKind::Enter { serial } => { + if self.alpha == 1.0 { + pointer.set_cursor(serial, None, 0, 0); + } + }, + PointerEventKind::Leave { .. } => {} _ => { debug!("Mouse event"); self.exit = true;