config: add focus-tiles action
This commit is contained in:
parent
bd85db5b59
commit
57a49d5299
11 changed files with 61 additions and 1 deletions
|
|
@ -2198,6 +2198,12 @@ impl ConfigProxyHandler {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_seat_focus_tiles(&self, seat: Seat) -> Result<(), CphError> {
|
||||
let seat = self.get_seat(seat)?;
|
||||
seat.focus_tiles();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn spaces_change(&self) {
|
||||
struct V;
|
||||
impl NodeVisitorBase for V {
|
||||
|
|
@ -3055,6 +3061,9 @@ impl ConfigProxyHandler {
|
|||
ClientMessage::SeatFocusLayerRel { seat, direction } => self
|
||||
.handle_seat_focus_layer_rel(seat, direction)
|
||||
.wrn("seat_focus_layer_rel")?,
|
||||
ClientMessage::SeatFocusTiles { seat } => {
|
||||
self.handle_seat_focus_tiles(seat).wrn("seat_focus_tiles")?
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -936,6 +936,32 @@ impl WlSeatGlobal {
|
|||
);
|
||||
}
|
||||
|
||||
pub fn focus_tiles(self: &Rc<Self>) {
|
||||
let current = self.keyboard_node.get();
|
||||
if matches!(
|
||||
current.node_layer().layer(),
|
||||
NodeLayer::Tiled | NodeLayer::Fullscreen,
|
||||
) {
|
||||
return;
|
||||
}
|
||||
let Some(output) = current.node_output() else {
|
||||
return;
|
||||
};
|
||||
let Some(ws) = output.workspace.get() else {
|
||||
return;
|
||||
};
|
||||
let node = match ws.fullscreen.get() {
|
||||
Some(fs) => fs as Rc<dyn Node>,
|
||||
_ => match ws.container.get() {
|
||||
Some(c) => c,
|
||||
_ => return,
|
||||
},
|
||||
};
|
||||
if node.node_visible() && node.node_accepts_focus() {
|
||||
node.node_do_focus(self, Direction::Unspecified);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_selection_<T, X, S>(
|
||||
self: &Rc<Self>,
|
||||
field: &CloneCell<Option<Rc<dyn DynDataSource>>>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue