Make right click during move toggle floating
Browse files at this commit1aa60f0da3e7f1a0bf50d6b88d59db6ba094d4f0Parent: bd1fd831 changed file +10 -0
- src/input/move_grab.rs +10 -0
src/input/move_grab.rsmodified+10 -0
| @@ -123,6 +123,16 @@ impl PointerGrab<State> for MoveGrab { | ||
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | + // When moving with the left button, right toggles floating, and vice versa. | |
| 127 | + let toggle_floating_button = if self.start_data.button == 0x110 { | |
| 128 | + 0x111 | |
| 129 | + } else { | |
| 130 | + 0x110 | |
| 131 | + }; | |
| 132 | + if event.button == toggle_floating_button && event.state == ButtonState::Pressed { | |
| 133 | + data.niri.layout.toggle_window_floating(Some(&self.window)); | |
| 134 | + } | |
| 135 | + | |
| 126 | 136 | if !handle.current_pressed().contains(&self.start_data.button) { |
| 127 | 137 | // The button that initiated the grab was released. |
| 128 | 138 | handle.unset_grab(self, data, event.serial, event.time, true); |