input: Add minimize shortcut

This commit is contained in:
Victoria Brekenfeld 2024-02-27 13:47:59 +01:00 committed by Victoria Brekenfeld
parent 32424d156a
commit 9540005577
2 changed files with 10 additions and 0 deletions

View file

@ -188,6 +188,7 @@ pub enum Action {
Resizing(ResizeDirection),
#[serde(skip)]
_ResizingInternal(ResizeDirection, ResizeEdge, KeyState),
Minimize,
Maximize,
Spawn(String),
}

View file

@ -2025,6 +2025,15 @@ impl State {
}
}
}
Action::Minimize => {
let current_output = seat.active_output();
let workspace = self.common.shell.active_space_mut(&current_output);
let focus_stack = workspace.focus_stack.get(seat);
let focused_window = focus_stack.last().cloned();
if let Some(window) = focused_window {
self.common.shell.minimize_request(&window);
}
}
Action::Maximize => {
let current_output = seat.active_output();
let workspace = self.common.shell.active_space_mut(&current_output);