diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-05-11 09:26:49 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-05-11 09:26:49 +0400 |
| commit | 2fd9a03bd71b4709659cdd35192109b47c3b0e10 (patch) | |
| tree | a419bad2e39ea38315e56e41e2cec1dbfca4b8f9 /src | |
| parent | b101f9b5f8acfb638f94962f76cbbb407d419664 (diff) | |
| download | niri-2fd9a03bd71b4709659cdd35192109b47c3b0e10.tar.gz niri-2fd9a03bd71b4709659cdd35192109b47c3b0e10.tar.bz2 niri-2fd9a03bd71b4709659cdd35192109b47c3b0e10.zip | |
Stop confining the pointer during resize grab
Diffstat (limited to 'src')
| -rw-r--r-- | src/handlers/xdg_shell.rs | 1 | ||||
| -rw-r--r-- | src/input.rs | 1 | ||||
| -rw-r--r-- | src/niri.rs | 7 | ||||
| -rw-r--r-- | src/resize_grab.rs | 1 |
4 files changed, 10 insertions, 0 deletions
diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index 5e255d17..afd0bab9 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -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( diff --git a/src/input.rs b/src/input.rs index bb970dbf..95f16b9b 100644 --- a/src/input.rs +++ b/src/input.rs @@ -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; } } } diff --git a/src/niri.rs b/src/niri.rs index a2ecd912..0fa95442 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -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; } diff --git a/src/resize_grab.rs b/src/resize_grab.rs index 3bb880ad..21bca859 100644 --- a/src/resize_grab.rs +++ b/src/resize_grab.rs @@ -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; } } |
