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
@@ -841,6 +841,11 @@ pub fn publish_rotation(rot : Int) -> Unit {
c_host_set_int(12, rot)
}
///| Publish whether show-desktop has the windows hidden.
pub fn publish_desktop_shown(shown : Bool) -> Unit {
c_host_set_int(13, if shown { 1 } else { 0 })
}
///| Publish the power timeouts, in minutes (0: never).
pub fn publish_power(screen_off : Int, suspend : Int) -> Unit {
c_host_set_int(5, screen_off)
@@ -905,6 +910,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)
///|
@@ -949,6 +956,7 @@ pub fn next_request() -> HostRequest? {
20 => Some(SetBrightness(c_host_req_int()))
21 => Some(SetOskVisible(c_host_req_int() != 0))
22 => Some(SetRotation(c_host_req_int()))
23 => Some(ToggleDesktop)
40 => Some(SetDesktop(c_host_req_int()))
44 => Some(FaceUnlock(c_host_req_int()))
45 => {