aboutsummaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/input')
-rw-r--r--src/input/mod.rs8
-rw-r--r--src/input/resize_grab.rs4
-rw-r--r--src/input/view_offset_grab.rs4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs
index acb08e1c..d0e1c55b 100644
--- a/src/input/mod.rs
+++ b/src/input/mod.rs
@@ -935,7 +935,7 @@ impl State {
// Check if we have an active pointer constraint.
let mut pointer_confined = None;
if let Some(focus) = &self.niri.pointer_focus.surface {
- let pos_within_surface = pos.to_i32_round() - focus.1;
+ let pos_within_surface = pos - focus.1;
let mut pointer_locked = false;
with_pointer_constraint(&focus.0, &pointer, |constraint| {
@@ -946,7 +946,7 @@ impl State {
// Constraint does not apply if not within region.
if let Some(region) = constraint.region() {
- if !region.contains(pos_within_surface) {
+ if !region.contains(pos_within_surface.to_i32_round()) {
return;
}
}
@@ -1036,8 +1036,8 @@ impl State {
// Prevent the pointer from leaving the confine region, if any.
if let Some(region) = region {
- let new_pos_within_surface = new_pos.to_i32_round() - focus_surface.1;
- if !region.contains(new_pos_within_surface) {
+ let new_pos_within_surface = new_pos - focus_surface.1;
+ if !region.contains(new_pos_within_surface.to_i32_round()) {
prevent = true;
}
}
diff --git a/src/input/resize_grab.rs b/src/input/resize_grab.rs
index 38483ca6..535bae32 100644
--- a/src/input/resize_grab.rs
+++ b/src/input/resize_grab.rs
@@ -35,7 +35,7 @@ impl PointerGrab<State> for ResizeGrab {
&mut self,
data: &mut State,
handle: &mut PointerInnerHandle<'_, State>,
- _focus: Option<(<State as SeatHandler>::PointerFocus, Point<i32, Logical>)>,
+ _focus: Option<(<State as SeatHandler>::PointerFocus, Point<f64, Logical>)>,
event: &MotionEvent,
) {
// While the grab is active, no client has pointer focus.
@@ -60,7 +60,7 @@ impl PointerGrab<State> for ResizeGrab {
&mut self,
data: &mut State,
handle: &mut PointerInnerHandle<'_, State>,
- _focus: Option<(<State as SeatHandler>::PointerFocus, Point<i32, Logical>)>,
+ _focus: Option<(<State as SeatHandler>::PointerFocus, Point<f64, Logical>)>,
event: &RelativeMotionEvent,
) {
// While the grab is active, no client has pointer focus.
diff --git a/src/input/view_offset_grab.rs b/src/input/view_offset_grab.rs
index 4e2d2785..b4f9f96c 100644
--- a/src/input/view_offset_grab.rs
+++ b/src/input/view_offset_grab.rs
@@ -46,7 +46,7 @@ impl PointerGrab<State> for ViewOffsetGrab {
&mut self,
data: &mut State,
handle: &mut PointerInnerHandle<'_, State>,
- _focus: Option<(<State as SeatHandler>::PointerFocus, Point<i32, Logical>)>,
+ _focus: Option<(<State as SeatHandler>::PointerFocus, Point<f64, Logical>)>,
event: &MotionEvent,
) {
// While the grab is active, no client has pointer focus.
@@ -74,7 +74,7 @@ impl PointerGrab<State> for ViewOffsetGrab {
&mut self,
data: &mut State,
handle: &mut PointerInnerHandle<'_, State>,
- _focus: Option<(<State as SeatHandler>::PointerFocus, Point<i32, Logical>)>,
+ _focus: Option<(<State as SeatHandler>::PointerFocus, Point<f64, Logical>)>,
event: &RelativeMotionEvent,
) {
// While the grab is active, no client has pointer focus.