- 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:
1 parent
2e00009c79
commit
74235cb0ca
84 files changed
+1525
-864
No files matched your search
@@ -21,8 +21,26 @@ pub fn ChandraCompositor::note_activity(self : ChandraCompositor, now_ms : UInt6
|
||||
self.last_input_ms = now_ms
|
||||
}
|
||||
|
||||
///| Check the idle timeouts at monotonic time `now_ms`.
|
||||
///| Turn the screen off or back on from a manual action (power button or `chandra-ctl screen`).
|
||||
pub fn ChandraCompositor::set_manual_screen_off(
|
||||
self : ChandraCompositor,
|
||||
off : Bool,
|
||||
) -> Unit {
|
||||
self.manual_screen_off = off
|
||||
if !off {
|
||||
self.note_activity(@sys.monotonic_ms())
|
||||
}
|
||||
}
|
||||
|
||||
///| Check the idle timeouts and manual screen blank state at monotonic time `now_ms`.
|
||||
pub fn ChandraCompositor::power_tick(self : ChandraCompositor, now_ms : UInt64) -> PowerChange {
|
||||
if self.manual_screen_off {
|
||||
if !self.screen_off {
|
||||
self.screen_off = true
|
||||
return ScreenOff
|
||||
}
|
||||
return NoChange
|
||||
}
|
||||
let idle = if now_ms > self.last_input_ms { now_ms - self.last_input_ms } else { 0UL }
|
||||
let minutes = fn(m : Int) { m.to_uint64() * 60000UL }
|
||||
let off = self.shell.screen_off_min
|
||||
|
||||
Reference in new issue
Block a user