mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-21 21:39:33 +01:00
fix(desktop): under a closed lid, just keep blinking, and say what happened
RC3's lid path went dark on the real MacBook without a word: it waited for CBClamshellState, gave up after two tries, and wrote ClamshellUpdate 1 back on every failed proof, and none of its silent paths left a trace without a Terminal launch. Now, while the lid sensor (AppleClamshellState) says closed, the built-in display is off and the Mac is on its power adapter, the logo is told the lid is open (and each keyboard that it is closed) at the start of every cycle, with no tries and no give-up: monotone, so nothing is toggled in between. With no other display on the display sleeps, which also keeps the logo dark, so if the first rise does not move it the logo is told the display woke (DisplayPowerStateEvent 2); DidSleep is written back at the end only if that was sent. The end of a blink, and the marker recovery, still put the logo back to dark as a closed lid has it. What the closed lid did last is a line in the View menu, under Apple Logo Blink Styles: "Lid Closed: blinking", "blinking (display told awake)", "stayed dark, macOS keeps the logo off", or why it was not tried (on battery, no keyboard to keep dark, no lid sensor), with the time. The child writes it to logo-lid next to desktop.json, with the readings on a second line; the app reads it every two seconds. The battery and keyboard gates stay: the lid helper only holds on the adapter, and a keyboard told the lid is open would light under it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c53d424a7
commit
c307d63d3b
4 files changed
+470
-198
No files matched your search
@@ -32,6 +32,9 @@ pub struct AppMenu {
|
||||
pub logo_switch: Option<CheckMenuItem>,
|
||||
/// One item per state and style, empty without the switch.
|
||||
pub logo_styles: Vec<(Signal, BlinkStyle, CheckMenuItem)>,
|
||||
/// What the closed lid did with the logo last, a line that cannot be
|
||||
/// clicked. None without the switch.
|
||||
pub logo_lid: Option<MenuItem>,
|
||||
}
|
||||
|
||||
pub fn build_menu(config: &Config) -> muda::Result<AppMenu> {
|
||||
@@ -117,6 +120,7 @@ pub fn build_menu(config: &Config) -> muda::Result<AppMenu> {
|
||||
// style for each state behind it.
|
||||
let mut logo_styles = Vec::new();
|
||||
let mut logo_switch = None;
|
||||
let mut logo_lid = None;
|
||||
if logo::available() {
|
||||
let switch = CheckMenuItem::with_id(
|
||||
menu_id::LOGO_BLINK,
|
||||
@@ -140,9 +144,12 @@ pub fn build_menu(config: &Config) -> muda::Result<AppMenu> {
|
||||
submenu.append(&group)?;
|
||||
}
|
||||
// Right under "Always Open in Full Screen", before the separator.
|
||||
let lid = MenuItem::new(logo::lid_status_line(), false, None);
|
||||
view.insert(&switch, 4)?;
|
||||
view.insert(&submenu, 5)?;
|
||||
view.insert(&lid, 6)?;
|
||||
logo_switch = Some(switch);
|
||||
logo_lid = Some(lid);
|
||||
}
|
||||
let window_menu = Submenu::with_items(
|
||||
"Window",
|
||||
@@ -172,5 +179,6 @@ pub fn build_menu(config: &Config) -> muda::Result<AppMenu> {
|
||||
start_fullscreen,
|
||||
logo_switch,
|
||||
logo_styles,
|
||||
logo_lid,
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user