Launcher: Reload session, and Log out moves in from its own module
CI / test (push) Failing after 17s
CI / test (push) Failing after 17s
The Application Launcher's menu now ends in a session row: Reload, Log out, Suspend, Restart,
Power off. Log out, Restart and Power off take a second click on the same button (a status line
says "Click Log out again to confirm"); Reload and Suspend act at once.
- Reload calls the new session.reload, which reaches the shell as the ReloadSession request
(native stub: request 8 with n 1; host plasmoids.wit: reload-session; host-wasm: Req::ReloadSession)
and runs DesktopShell::reload_modules(""): every panel module again from disk, in place, with
its settings. Windows and apps keep running. The compositor redraws the whole frame after it.
- Suspend / Restart / Power off use the power capability, the same calls as Settings > Power.
- The standalone logout module is gone (component, world, components.txt). Saved panels drop
"logout", or get the launcher in its place when they had none; panel.edn is rewritten without
it. A stale logout.wasm is hidden from Settings > Panel (retired_modules).
- Tests: lib/launcher session row, shell migrate_panel, host input tests for Log out and Reload,
host-wasm launcher session row; control_test uses inspector.wasm instead of logout.wasm.
- README and docs/reloading.md describe the session row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjKUnSS3D92ThigvJf
This commit is contained in:
37 files changed
+420
-827
No files matched your search
@@ -1,5 +1,7 @@
|
||||
///| Implementation of `chandra:desktop/plasmoid` for the launcher.
|
||||
/// The state machine lives in lib/launcher; this adapts host capabilities.
|
||||
/// The state machine lives in lib/launcher; this adapts host capabilities: the app catalog and
|
||||
/// launch, and for the session row `session` (reload, log out) and `power` (suspend, restart,
|
||||
/// power off, the same calls as the Settings Power tab).
|
||||
|
||||
///|
|
||||
let state : @logic.State = @logic.State::new()
|
||||
@@ -38,5 +40,20 @@ pub fn on_event(target : Surface, event : @types.InputEvent) -> Bool {
|
||||
WIDGET => Widget
|
||||
POPUP => Popup
|
||||
}
|
||||
@logic.handle_event(@app_catalog.list_apps(), state, t, event, @app_launch.launch)
|
||||
@logic.handle_event(@app_catalog.list_apps(), state, t, event, @app_launch.launch, session=run_action)
|
||||
}
|
||||
|
||||
///| Carry out a (confirmed) session-row action.
|
||||
fn run_action(a : Int) -> Unit {
|
||||
if a == @logic.action_reload {
|
||||
@session.reload()
|
||||
} else if a == @logic.action_logout {
|
||||
@session.logout()
|
||||
} else if a == @logic.action_suspend {
|
||||
@power.suspend()
|
||||
} else if a == @logic.action_restart {
|
||||
@power.reboot()
|
||||
} else if a == @logic.action_power_off {
|
||||
@power.power_off()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user