1
0
Fork 0
forked from wry/wry

add toggle focus between floating and tiled layers

Adds focus_floats(), toggle_focus_float_tiled(), and their IPC
bindings so users can bind a key to swap focus between the floating
and tiled layers.
This commit is contained in:
atagen 2026-03-07 14:55:31 +11:00 committed by kossLAN
parent 23ad546a39
commit d353779c10
No known key found for this signature in database
8 changed files with 82 additions and 0 deletions

View file

@ -399,6 +399,14 @@ impl ConfigClient {
self.send(&ClientMessage::SeatFocusTiles { seat });
}
pub fn seat_focus_floats(&self, seat: Seat) {
self.send(&ClientMessage::SeatFocusFloats { seat });
}
pub fn seat_toggle_focus_float_tiled(&self, seat: Seat) {
self.send(&ClientMessage::SeatToggleFocusFloatTiled { seat });
}
pub fn seat_focus(&self, seat: Seat, direction: Direction) {
self.send(&ClientMessage::SeatFocus { seat, direction });
}

View file

@ -747,6 +747,12 @@ pub enum ClientMessage<'a> {
SeatFocusTiles {
seat: Seat,
},
SeatFocusFloats {
seat: Seat,
},
SeatToggleFocusFloatTiled {
seat: Seat,
},
SetMiddleClickPasteEnabled {
enabled: bool,
},

View file

@ -321,6 +321,19 @@ impl Seat {
get!().seat_focus_tiles(self)
}
/// Moves the keyboard focus to the topmost floating window.
pub fn focus_floats(self) {
get!().seat_focus_floats(self)
}
/// Toggles keyboard focus between the floating and tiled layers.
///
/// If focus is on the tiled or fullscreen layer, focus moves to the topmost float.
/// If focus is on the floating layer, focus moves to the tiled layer.
pub fn toggle_focus_float_tiled(self) {
get!().seat_toggle_focus_float_tiled(self)
}
/// Moves the keyboard focus of the seat in the specified direction.
pub fn focus(self, direction: Direction) {
get!().seat_focus(self, direction)