aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-05-23 22:59:04 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-05-23 23:08:51 +0300
commitef44adea69fe891d5b2837740536d6c0f86fa691 (patch)
tree2c59be5b3fda54cdc9e2bd4454b81c170d82508a /src
parent7fdb918cd04076b173a38f026dc5c27ac830b028 (diff)
downloadniri-ef44adea69fe891d5b2837740536d6c0f86fa691.tar.gz
niri-ef44adea69fe891d5b2837740536d6c0f86fa691.tar.bz2
niri-ef44adea69fe891d5b2837740536d6c0f86fa691.zip
Set pointer contents straight to nothing when disabling pointer
Diffstat (limited to 'src')
-rw-r--r--src/niri.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/niri.rs b/src/niri.rs
index 79d20639..fd8d586a 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -929,7 +929,7 @@ impl State {
let pointer = &self.niri.seat.get_pointer().unwrap();
let location = pointer.current_location();
- let under = match self.niri.pointer_visibility {
+ let mut under = match self.niri.pointer_visibility {
PointerVisibility::Disabled => PointContents::default(),
_ => self.niri.contents_under(location),
};
@@ -943,6 +943,14 @@ impl State {
// Disable the hidden pointer if the contents underneath have changed.
if !self.niri.pointer_visibility.is_visible() {
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();
+ if self.niri.pointer_contents == under {
+ return false;
+ }
}
self.niri.pointer_contents.clone_from(&under);