forge
Explore
Log in

Don't you dare go Hollow

Pass new pointer location to pointer.motion()

Browse files at this commit

1035f3e6cd4e9c530451f29d1903f43530b85df0Ivan MolodetskikhParent: ec1a888
This is correct, it was a bug in smallvil.
src/input.rsmodified+2 -2
@@ -69,7 +69,7 @@ impl Niri {
69 pointer_location.x = pointer_location.x.clamp(0., output_geo.size.w as f64);69 pointer_location.x = pointer_location.x.clamp(0., output_geo.size.w as f64);
70 pointer_location.y = pointer_location.y.clamp(0., output_geo.size.h as f64);70 pointer_location.y = pointer_location.y.clamp(0., output_geo.size.h as f64);
71 71
72- let under = self.surface_under_pointer(&pointer);72+ let under = self.surface_under(pointer_location);
73 pointer.motion(73 pointer.motion(
74 self,74 self,
75 under.clone(),75 under.clone(),
@@ -101,7 +101,7 @@ impl Niri {
101 101
102 let pointer = self.seat.get_pointer().unwrap();102 let pointer = self.seat.get_pointer().unwrap();
103 103
104- let under = self.surface_under_pointer(&pointer);104+ let under = self.surface_under(pos);
105 105
106 pointer.motion(106 pointer.motion(
107 self,107 self,
src/niri.rsmodified+2 -4
@@ -5,7 +5,6 @@ use std::time::Duration;
5 use smithay::desktop::space::space_render_elements;5 use smithay::desktop::space::space_render_elements;
6 use smithay::desktop::{Space, Window, WindowSurfaceType};6 use smithay::desktop::{Space, Window, WindowSurfaceType};
7 use smithay::input::keyboard::XkbConfig;7 use smithay::input::keyboard::XkbConfig;
8-use smithay::input::pointer::PointerHandle;
9 use smithay::input::{Seat, SeatState};8 use smithay::input::{Seat, SeatState};
10 use smithay::output::Output;9 use smithay::output::Output;
11 use smithay::reexports::calloop::generic::Generic;10 use smithay::reexports::calloop::generic::Generic;
@@ -119,11 +118,10 @@ impl Niri {
119 }118 }
120 }119 }
121 120
122- pub fn surface_under_pointer(121+ pub fn surface_under(
123 &self,122 &self,
124- pointer: &PointerHandle<Self>,123+ pos: Point<f64, Logical>,
125 ) -> Option<(WlSurface, Point<i32, Logical>)> {124 ) -> Option<(WlSurface, Point<i32, Logical>)> {
126- let pos = pointer.current_location();
127 self.space125 self.space
128 .element_under(pos)126 .element_under(pos)
129 .and_then(|(window, location)| {127 .and_then(|(window, location)| {