theme, event_loop: window_controls.bar_bg slot + graceful exit on compositor disconnect
`WindowControlsSpec` gains `bar_bg`, the background fill of the SSD title-bar strip the close / maximize / minimize controls sit on. Forge used to paint that strip with `palette.surface` clamped to alpha 1.0 — a hack on a translucent panel token. With a dedicated slot the theme decides directly: `@off-white` in light and a new `@window-bar-dark` shade in dark. Schema gets the matching `Option<String>` field (defaulting to `palette.surface` to keep existing themes rendering the same) and the fallback `WindowControlsSpec` seeds `Color::WHITE` so a missing theme still draws something readable.
`try_run`'s dispatch loop previously `.expect("dispatch")`-ed every calloop error. When the compositor closes the wayland socket — `wl_display.error`, forge crashing, the user logging out — the loop saw a `BrokenPipe` / `ConnectionReset` and panicked, which polluted the user's stderr with a backtrace for what is just "the session ended". The match now treats those two `IoError` kinds as a clean shutdown: it prints `Connection::protocol_error()` (the typed `wl_display.error` if the server sent one), sets `exit_requested = true`, and lets the loop drain out normally. Any other dispatch error keeps panicking — those are still genuine bugs.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
"navy": "#0A032E",
|
||||
"indigo": "#221A5A",
|
||||
"midnight": "#181045",
|
||||
"window-bar-dark": "#2B2838",
|
||||
"white": "#FFFFFF",
|
||||
"off-white": "#EAE9EB",
|
||||
"sky": "#2AA7F7",
|
||||
@@ -93,6 +94,7 @@
|
||||
"light": {
|
||||
"launcher": { "background": "@white/E6", "border_radius": 24.0 },
|
||||
"window_controls": {
|
||||
"bar_bg": "@off-white",
|
||||
"icon": "@slate",
|
||||
"hover_bg": "@navy/14",
|
||||
"pressed_bg": "@navy/24",
|
||||
@@ -206,6 +208,7 @@
|
||||
"dark": {
|
||||
"launcher": { "background": "@indigo/E6", "border_radius": 24.0 },
|
||||
"window_controls": {
|
||||
"bar_bg": "@window-bar-dark",
|
||||
"icon": "@silver",
|
||||
"hover_bg": "@white/18",
|
||||
"pressed_bg": "@white/26",
|
||||
|
||||
Reference in New Issue
Block a user