aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-08-09 17:51:02 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-08-10 14:50:51 +0400
commit1035f3e6cd4e9c530451f29d1903f43530b85df0 (patch)
tree21a68b0fecc8aea37966e3357e4c95ba77f01735
parentec1a888386261bf8cd4f5dd9a272d329bb05e110 (diff)
downloadniri-1035f3e6cd4e9c530451f29d1903f43530b85df0.tar.gz
niri-1035f3e6cd4e9c530451f29d1903f43530b85df0.tar.bz2
niri-1035f3e6cd4e9c530451f29d1903f43530b85df0.zip
Pass new pointer location to pointer.motion()
This is correct, it was a bug in smallvil.
-rw-r--r--src/input.rs4
-rw-r--r--src/niri.rs6
2 files changed, 4 insertions, 6 deletions
diff --git a/src/input.rs b/src/input.rs
index b7b1959b..c10f3e15 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -69,7 +69,7 @@ impl Niri {
pointer_location.x = pointer_location.x.clamp(0., output_geo.size.w as f64);
pointer_location.y = pointer_location.y.clamp(0., output_geo.size.h as f64);
- let under = self.surface_under_pointer(&pointer);
+ let under = self.surface_under(pointer_location);
pointer.motion(
self,
under.clone(),
@@ -101,7 +101,7 @@ impl Niri {
let pointer = self.seat.get_pointer().unwrap();
- let under = self.surface_under_pointer(&pointer);
+ let under = self.surface_under(pos);
pointer.motion(
self,
diff --git a/src/niri.rs b/src/niri.rs
index 1750ed3d..6318fd95 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -5,7 +5,6 @@ use std::time::Duration;
use smithay::desktop::space::space_render_elements;
use smithay::desktop::{Space, Window, WindowSurfaceType};
use smithay::input::keyboard::XkbConfig;
-use smithay::input::pointer::PointerHandle;
use smithay::input::{Seat, SeatState};
use smithay::output::Output;
use smithay::reexports::calloop::generic::Generic;
@@ -119,11 +118,10 @@ impl Niri {
}
}
- pub fn surface_under_pointer(
+ pub fn surface_under(
&self,
- pointer: &PointerHandle<Self>,
+ pos: Point<f64, Logical>,
) -> Option<(WlSurface, Point<i32, Logical>)> {
- let pos = pointer.current_location();
self.space
.element_under(pos)
.and_then(|(window, location)| {