Super+D shows the desktop: minimize every window, again to bring them back

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hktZQ73WicBDmBgP57
This commit is contained in:
Claude authored and V committed 2026-11-25 17:07:33 +00:00
1 parent 11d7e4d276
commit 0f4c84b966
3 files changed
+154

No files matched your search

+47
View File
@@ -1074,3 +1074,50 @@ test "compose_scene hands the host a scene only when something changed" {
assert_true(comp.switcher_open())
assert_true(comp.compose_scene() is Some(_))
}
///|
test "super+d minimizes every window to show the desktop, and again brings them back" {
let socket_path = "/tmp/wayland-moon-supd-" + @sys.getpid().to_string() + ".sock"
let theme = @scene.ThemeTokens::moon_night()
let comp = @host.MoonPlasmaCompositor::new(socket_path, theme, 1280, 720).unwrap()
ignore(open_and_configure_client(comp, socket_path, "A", "a"))
ignore(open_and_configure_client(comp, socket_path, "B", "b"))
ignore(comp.compose_frame())
let key = fn(code : UInt, down : Bool, t : UInt) {
comp.handle_input(@nested.InputEvent::Key(code, down), t)
}
let focused = fn() {
let mut f = 0UL
for id, w in comp.windows {
if w.focused {
f = id
}
}
f
}
assert_eq(focused(), 2UL)
// Super+D: both windows are minimized and the launcher does not open.
key(125U, true, 1U)
key(32U, true, 2U)
key(32U, false, 3U)
key(125U, false, 4U)
assert_true(comp.wm.windows.get(1UL).unwrap().minimized)
assert_true(comp.wm.windows.get(2UL).unwrap().minimized)
assert_eq(comp.wm.stacking_order().length(), 0)
assert_true(comp.desktop_shown())
assert_false(comp.shell.popup_open())
// Super+D again: they come back, the one that was on top focused.
key(125U, true, 10U)
key(32U, true, 11U)
key(32U, false, 12U)
key(125U, false, 13U)
assert_false(comp.wm.windows.get(1UL).unwrap().minimized)
assert_false(comp.wm.windows.get(2UL).unwrap().minimized)
assert_false(comp.desktop_shown())
assert_false(comp.shell.popup_open())
assert_eq(focused(), 2UL)
// D without Super is an ordinary key.
key(32U, true, 20U)
key(32U, false, 21U)
assert_false(comp.wm.windows.get(2UL).unwrap().minimized)
}