mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Make right click during move toggle floating
This commit is contained in:
@@ -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) {
|
if !handle.current_pressed().contains(&self.start_data.button) {
|
||||||
// The button that initiated the grab was released.
|
// The button that initiated the grab was released.
|
||||||
handle.unset_grab(self, data, event.serial, event.time, true);
|
handle.unset_grab(self, data, event.serial, event.time, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user