Panel: add a Show Desktop module at the panel's end

- Clicking it hides every window, as Super+D does; it stays lit while the desktop is shown.
- A second click brings the hidden windows back.
- New show-desktop capability (wit toggle and publish-desktop-shown) for the wasm module.
- Added to the default panel after session settings; existing panels are unchanged.
- Test covers hiding, the lit state, and restoring the windows.
This commit is contained in:
nandi committed 2026-11-30 12:24:01 -08:00
1 parent 51852f0dac
commit 44bb77871d
31 files changed
+869 -49

No files matched your search

+8
View File
@@ -427,6 +427,11 @@ pub fn publish_rotation(rot : Int) -> Unit {
@hostpl.publish_rotation(rot.reinterpret_as_uint())
}
///| Publish whether show-desktop has the windows hidden.
pub fn publish_desktop_shown(shown : Bool) -> Unit {
@hostpl.publish_desktop_shown(shown)
}
///| The power timeouts, in minutes (0: never).
pub fn publish_power(screen_off : Int, suspend : Int) -> Unit {
@hostpl.publish_power(screen_off.reinterpret_as_uint(), suspend.reinterpret_as_uint())
@@ -487,6 +492,8 @@ pub(all) enum HostRequest {
SetOskVisible(Bool)
/// The rotation capability: set display orientation (0..3).
SetRotation(Int)
/// The show-desktop capability's `toggle`: hide the windows, or bring back the ones it hid.
ToggleDesktop
} derive(Eq, Debug)
///|
@@ -518,6 +525,7 @@ pub fn next_request() -> HostRequest? {
Some(GameLibrary(r)) => Some(GameLibrary(r.action, r.game, r.mode))
Some(SetOskVisible(v)) => Some(SetOskVisible(v))
Some(SetRotation(r)) => Some(SetRotation(r))
Some(ToggleDesktop) => Some(ToggleDesktop)
}
}