Add backlight control to the shell and regenerate WIT bindings
CI / test (push) Canceled after 0s

- Add compositor/shell/backlight.mbt for backlight control in the shell
- Update wit/capabilities.wit and wit/host/plasmoids.wit, then regenerate the component and interface ffi.mbt bindings (mostly export reordering)
- Add world/launcher-widget/README.md
This commit is contained in:
nandi committed 2026-11-28 02:16:07 -08:00
1 parent 2e00009c79
commit 74235cb0ca
84 files changed
+1525 -864

No files matched your search

+17
View File
@@ -782,6 +782,7 @@ fn DesktopShell::publish_host_data(self : DesktopShell) -> Unit {
}
if self.any_cap("power") {
@wasm.publish_power(self.screen_off_min, self.suspend_min)
self.refresh_brightness()
}
if self.any_cap("shortcuts") {
self.publish_shortcuts()
@@ -915,6 +916,21 @@ pub fn DesktopShell::set_power_timeouts(self : DesktopShell, screen_off : Int, s
self.save_state()
}
///| Refresh cached backlight brightness (0..100, or -1 if absent) and publish to modules.
pub fn DesktopShell::refresh_brightness(self : DesktopShell) -> Unit {
let pct = read_backlight_polled()
self.brightness_pct = pct
@wasm.publish_brightness(pct)
}
///| Set display backlight percentage (5..100) and publish the updated value.
pub fn DesktopShell::set_brightness(self : DesktopShell, pct : Int) -> Int {
let res = write_backlight_percent(pct, self.display)
self.brightness_pct = res
@wasm.publish_brightness(res)
res
}
///| Start the catalog app `id` (a desktop file id) and remember it as the latest launch.
fn DesktopShell::launch_catalog_app(self : DesktopShell, id : String) -> Unit {
match self.command_for(id) {
@@ -950,6 +966,7 @@ fn DesktopShell::process_requests(self : DesktopShell) -> Unit {
Some(Screenshot(code)) => self.actions.push(Screenshot(code))
Some(SetScreenOff(m)) => self.set_power_timeouts(m, self.suspend_min)
Some(SetSuspendAfter(m)) => self.set_power_timeouts(self.screen_off_min, m)
Some(SetBrightness(p)) => ignore(self.set_brightness(p))
Some(Shortcut(code)) => self.shortcut_request(code)
Some(DefaultApp(code)) => self.default_app_request(code)
Some(FaceUnlock(code)) => self.face.request(code)