diff options
| author | bogdanov <165584864+bbogdan-ov@users.noreply.github.com> | 2025-04-27 06:25:36 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-27 06:25:36 +0000 |
| commit | 758cca5432ee87157f6717081cc5e71c09031ea5 (patch) | |
| tree | 6dad8a29fdc9b6108a597f81fd1331e77a2932d9 /src/input | |
| parent | 78e3daf5f82b5870e998faf0e1efeaa048730976 (diff) | |
| download | niri-758cca5432ee87157f6717081cc5e71c09031ea5.tar.gz niri-758cca5432ee87157f6717081cc5e71c09031ea5.tar.bz2 niri-758cca5432ee87157f6717081cc5e71c09031ea5.zip | |
Fix pointer hiding so that it is no longer annoying (#1426)
* replace `pointer_hidden` with `pointer_visiblity`
* disable hidden pointer after content underneath has changed
* fixes
---------
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Diffstat (limited to 'src/input')
| -rw-r--r-- | src/input/mod.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index e7c2e38f..b5213351 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -42,7 +42,7 @@ use self::resize_grab::ResizeGrab; use self::spatial_movement_grab::SpatialMovementGrab; use crate::layout::scrolling::ScrollDirection; use crate::layout::{ActivateWindow, LayoutElement as _}; -use crate::niri::{CastTarget, State}; +use crate::niri::{CastTarget, PointerVisibility, State}; use crate::ui::screenshot_ui::ScreenshotUi; use crate::utils::spawning::spawn; use crate::utils::{center, get_monotonic_time, ResizeEdge}; @@ -477,13 +477,13 @@ impl State { } // niri keeps this set only while actively using a tablet, which means the cursor position - // is likely to change almost immediately, causing pointer_hidden to just flicker back and - // forth. + // is likely to change almost immediately, causing pointer_visibility to just flicker back + // and forth. if self.niri.tablet_cursor_location.is_some() { return; } - self.niri.pointer_hidden = true; + self.niri.pointer_visibility = PointerVisibility::Hidden; self.niri.queue_redraw_all(); } @@ -2014,7 +2014,7 @@ impl State { let mut new_pos = pos + event.delta(); // We received an event for the regular pointer, so show it now. - self.niri.pointer_hidden = false; + self.niri.pointer_visibility = PointerVisibility::Visible; self.niri.tablet_cursor_location = None; // Check if we have an active pointer constraint. @@ -2283,7 +2283,7 @@ impl State { self.niri.maybe_activate_pointer_constraint(); // We moved the pointer, show it. - self.niri.pointer_hidden = false; + self.niri.pointer_visibility = PointerVisibility::Visible; // We moved the regular pointer, so show it now. self.niri.tablet_cursor_location = None; @@ -2348,7 +2348,7 @@ impl State { } // We received an event for the regular pointer, so show it now. - self.niri.pointer_hidden = false; + self.niri.pointer_visibility = PointerVisibility::Visible; self.niri.tablet_cursor_location = None; let is_overview_open = self.niri.layout.is_overview_open(); @@ -2608,7 +2608,7 @@ impl State { // We received an event for the regular pointer, so show it now. This is also needed for // update_pointer_contents() below to return the real contents, necessary for the pointer // axis event to reach the window. - self.niri.pointer_hidden = false; + self.niri.pointer_visibility = PointerVisibility::Visible; self.niri.tablet_cursor_location = None; let timestamp = Duration::from_micros(event.time()); @@ -3053,7 +3053,7 @@ impl State { event.time_msec(), ); - self.niri.pointer_hidden = false; + self.niri.pointer_visibility = PointerVisibility::Visible; self.niri.tablet_cursor_location = Some(pos); } @@ -3145,7 +3145,7 @@ impl State { event.time_msec(), ); } - self.niri.pointer_hidden = false; + self.niri.pointer_visibility = PointerVisibility::Visible; self.niri.tablet_cursor_location = Some(pos); } ProximityState::Out => { @@ -3159,7 +3159,7 @@ impl State { self.move_cursor(pos); } - self.niri.pointer_hidden = false; + self.niri.pointer_visibility = PointerVisibility::Visible; self.niri.tablet_cursor_location = None; } } @@ -3591,7 +3591,7 @@ impl State { ); // We're using touch, hide the pointer. - self.niri.pointer_hidden = true; + self.niri.pointer_visibility = PointerVisibility::Disabled; } fn on_touch_up<I: InputBackend>(&mut self, evt: I::TouchUpEvent) { let Some(handle) = self.niri.seat.get_touch() else { |
