Stop confining the pointer during resize grab

This commit is contained in:
Ivan Molodetskikh
2024-05-11 09:26:49 +04:00
parent b101f9b5f8
commit 2fd9a03bd7
4 changed files with 10 additions and 0 deletions
+1
View File
@@ -100,6 +100,7 @@ impl XdgShellHandler for State {
let grab = ResizeGrab::new(start_data, window);
pointer.set_grab(self, grab, serial, Focus::Clear);
self.niri.interactive_resize_ongoing = true;
}
fn reposition_request(
+1
View File
@@ -1102,6 +1102,7 @@ impl State {
};
let grab = ResizeGrab::new(start_data, window);
pointer.set_grab(self, grab, serial, Focus::Clear);
self.niri.interactive_resize_ongoing = true;
}
}
}
+7
View File
@@ -232,6 +232,8 @@ pub struct Niri {
/// When this happens, the pointer also loses any focus. This is so that touch can prevent
/// various tooltips from sticking around.
pub pointer_hidden: bool,
// FIXME: this should be able to be removed once PointerFocus takes grabs into accound.
pub interactive_resize_ongoing: bool,
pub tablet_cursor_location: Option<Point<f64, Logical>>,
pub gesture_swipe_3f_cumulative: Option<(f64, f64)>,
pub vertical_wheel_tracker: ScrollTracker,
@@ -1502,6 +1504,7 @@ impl Niri {
dnd_icon: None,
pointer_focus: PointerFocus::default(),
pointer_hidden: false,
interactive_resize_ongoing: false,
tablet_cursor_location: None,
gesture_swipe_3f_cumulative: None,
vertical_wheel_tracker: ScrollTracker::new(120),
@@ -3664,9 +3667,13 @@ impl Niri {
let Some((surface, surface_loc)) = &new_under.surface else {
return;
};
if self.interactive_resize_ongoing {
return;
}
let pointer = &self.seat.get_pointer().unwrap();
with_pointer_constraint(surface, pointer, |constraint| {
let Some(constraint) = constraint else { return };
if constraint.is_active() {
return;
}
+1
View File
@@ -22,6 +22,7 @@ impl ResizeGrab {
fn on_ungrab(&mut self, state: &mut State) {
state.niri.layout.interactive_resize_end(&self.window);
state.niri.interactive_resize_ongoing = false;
}
}