diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-05-23 23:08:27 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-05-23 23:08:51 +0300 |
| commit | a605a3f016769ba2fd7e2147fe05c9ac3707f973 (patch) | |
| tree | 6b555fa2fa15c765cbf3cbdaebc1d167fb2b1938 /src | |
| parent | ef44adea69fe891d5b2837740536d6c0f86fa691 (diff) | |
| download | niri-a605a3f016769ba2fd7e2147fe05c9ac3707f973.tar.gz niri-a605a3f016769ba2fd7e2147fe05c9ac3707f973.tar.bz2 niri-a605a3f016769ba2fd7e2147fe05c9ac3707f973.zip | |
Account for hidden pointer in move_cursor()
Diffstat (limited to 'src')
| -rw-r--r-- | src/niri.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/niri.rs b/src/niri.rs index fd8d586a..c1d1b958 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -740,7 +740,21 @@ impl State { } pub fn move_cursor(&mut self, location: Point<f64, Logical>) { - let under = self.niri.contents_under(location); + let mut under = match self.niri.pointer_visibility { + PointerVisibility::Disabled => PointContents::default(), + _ => self.niri.contents_under(location), + }; + + // Disable the hidden pointer if the contents underneath have changed. + if !self.niri.pointer_visibility.is_visible() && self.niri.pointer_contents != under { + self.niri.pointer_visibility = PointerVisibility::Disabled; + + // When setting PointerVisibility::Hidden together with pointer contents changing, + // we can change straight to nothing to avoid one frame of hover. Notably, this can + // be triggered through warp-mouse-to-focus combined with hide-when-typing. + under = PointContents::default(); + } + self.niri.pointer_contents.clone_from(&under); let pointer = &self.niri.seat.get_pointer().unwrap(); |
