Skip to content

Commit

Permalink
Make right click during move toggle floating
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR committed Dec 14, 2024
1 parent b7fbf0d commit f0835eb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/input/move_grab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f0835eb

Please sign in to comment.