aboutsummaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-12-14 17:42:52 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-12-30 20:12:37 +0300
commit1aa60f0da3e7f1a0bf50d6b88d59db6ba094d4f0 (patch)
tree4f15736dc650e1b7c735bc7fd9c84659f0f2c40c /src/input
parentbd1fd8383c2cc4884cef194bf3ab3b239ec8f167 (diff)
downloadniri-1aa60f0da3e7f1a0bf50d6b88d59db6ba094d4f0.tar.gz
niri-1aa60f0da3e7f1a0bf50d6b88d59db6ba094d4f0.tar.bz2
niri-1aa60f0da3e7f1a0bf50d6b88d59db6ba094d4f0.zip
Make right click during move toggle floating
Diffstat (limited to 'src/input')
-rw-r--r--src/input/move_grab.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/input/move_grab.rs b/src/input/move_grab.rs
index c1d979bc..509a609b 100644
--- a/src/input/move_grab.rs
+++ b/src/input/move_grab.rs
@@ -123,6 +123,16 @@ impl PointerGrab<State> for MoveGrab {
}
}
+ // When moving with the left button, right toggles floating, and vice versa.
+ let toggle_floating_button = if self.start_data.button == 0x110 {
+ 0x111
+ } else {
+ 0x110
+ };
+ if event.button == toggle_floating_button && event.state == ButtonState::Pressed {
+ data.niri.layout.toggle_window_floating(Some(&self.window));
+ }
+
if !handle.current_pressed().contains(&self.start_data.button) {
// The button that initiated the grab was released.
handle.unset_grab(self, data, event.serial, event.time, true);