input: Prevent swipe gestures in screenshot UI and lock
Browse files at this commiteff4211be8fe806cd3c2090f7fdb192a78f75cf9Parent: 19ad2c51 changed file +13 -11
- src/input/mod.rs +13 -11
src/input/mod.rsmodified+13 -11
| @@ -3976,22 +3976,24 @@ impl State { | |||
| 3976 | } | 3976 | } |
| 3977 | 3977 | ||
| 3978 | fn on_gesture_swipe_begin<I: InputBackend>(&mut self, event: I::GestureSwipeBeginEvent) { | 3978 | fn on_gesture_swipe_begin<I: InputBackend>(&mut self, event: I::GestureSwipeBeginEvent) { |
| 3979 | - if self.niri.window_mru_ui.is_open() { | 3979 | + if self.niri.window_mru_ui.is_open() || self.niri.screenshot_ui.is_open() { |
| 3980 | - // Don't start swipe gestures while in the MRU. | 3980 | + // Don't start swipe gestures while in the compositor UI. |
| 3981 | return; | 3981 | return; |
| 3982 | } | 3982 | } |
| 3983 | 3983 | ||
| 3984 | - if event.fingers() == 3 { | 3984 | + if !self.niri.is_locked() { |
| 3985 | - self.niri.gesture_swipe_3f_cumulative = Some((0., 0.)); | 3985 | + if event.fingers() == 3 { |
| 3986 | + self.niri.gesture_swipe_3f_cumulative = Some((0., 0.)); | ||
| 3986 | 3987 | ||
| 3987 | - // We handled this event. | 3988 | + // We handled this event. |
| 3988 | - return; | 3989 | + return; |
| 3989 | - } else if event.fingers() == 4 { | 3990 | + } else if event.fingers() == 4 { |
| 3990 | - self.niri.layout.overview_gesture_begin(); | 3991 | + self.niri.layout.overview_gesture_begin(); |
| 3991 | - self.niri.queue_redraw_all(); | 3992 | + self.niri.queue_redraw_all(); |
| 3992 | 3993 | ||
| 3993 | - // We handled this event. | 3994 | + // We handled this event. |
| 3994 | - return; | 3995 | + return; |
| 3996 | + } | ||
| 3995 | } | 3997 | } |
| 3996 | 3998 | ||
| 3997 | let serial = SERIAL_COUNTER.next_serial(); | 3999 | let serial = SERIAL_COUNTER.next_serial(); |