srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/core/src/manager/focus.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/core/src/manager/focus.rs')
-rw-r--r--crates/core/src/manager/focus.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/core/src/manager/focus.rs b/crates/core/src/manager/focus.rs
index 6dae20a..f1473cf 100644
--- a/crates/core/src/manager/focus.rs
+++ b/crates/core/src/manager/focus.rs
@@ -45,6 +45,22 @@ impl WindowManager {
if workspace != self.current_workspace {
self.switch_workspace(workspace);
}
+ // A minimized window's dock icon (or Alt-Tab entry, or any
+ // other `focus_window` caller) has to un-minimize it too, not
+ // just focus it - without this, clicking a minimized app's
+ // dock icon left it focused (keyboard input, `srd clients`'
+ // own `focused: true`) while still `minimized: true`, still
+ // excluded from `visible_windows`/rendering. Reads exactly like
+ // the click did nothing, since the one visible thing "focused"
+ // usually implies (the window coming to the front) never
+ // happens. Every desktop's taskbar/dock has this behavior for
+ // free; this compositor's `Activate` (zwlr-foreign-toplevel)
+ // and `"focus"` IPC handlers both route through here already,
+ // so they get it too rather than each needing their own
+ // explicit restore call.
+ if let Some(w) = self.windows.get_mut(&id) {
+ w.minimized = false;
+ }
self.focused = Some(id);
self.raise_window(id);
}