forge
Explore
Log in

Don't you dare go Hollow

Skip refresh_pointer_contents() during tablet tool use

Browse files at this commit

d66c6ca51c1728adca05f82b60046e6725b2fff2Ivan MolodetskikhParent: 59a1001
Otherwise it confuses clients with a pointer motion, e.g. when pressing
down a tablet on a partially off-screen window (then it scrolls into
view and after the animation is done, refresh_pointer_contents() moves
the pointer).
src/niri.rsmodified+6 -0
@@ -1028,6 +1028,12 @@ impl State {
1028 }1028 }
1029 1029
1030 pub fn refresh_pointer_contents(&mut self) {1030 pub fn refresh_pointer_contents(&mut self) {
1031+ // Don't move the mouse pointer while the user is interacting with the tablet, as it causes
1032+ // unwanted jumps for the client.
1033+ if self.niri.tablet_cursor_location.is_some() {
1034+ return;
1035+ }
1036+
1031 let _span = tracy_client::span!("Niri::refresh_pointer_contents");1037 let _span = tracy_client::span!("Niri::refresh_pointer_contents");
1032 1038
1033 let pointer = &self.niri.seat.get_pointer().unwrap();1039 let pointer = &self.niri.seat.get_pointer().unwrap();