Session settings panel module: switch session restore and window placement on or off
CI / test (push) Failing after 16s
CI / test (push) Failing after 16s
- New 'session-settings' capability (wit/capabilities.wit: settings, is-on, set-setting) and 'session-settings' panel module: a "Session" button whose popup lists the session settings, each with an on/off switch. Clicking a row flips it at once (the list stays open); Up/Down move the highlight, Enter or Space flips it, Escape or a click elsewhere closes. In the default panel, between Wallpaper and Log out. - Two settings to start with, kept in state.edn and written only when off (absent means on): "Reopen windows at login" (:restore-session, the key session restore already read) and "Remember window positions" (:remember-windows; when off, floating windows aren't placed where their app was left and new places aren't recorded, but the saved ones are kept). - Served by both hosts: wasmer stub (native; settings table 6, bit mask in host int 3, requests 10/11) and host-wasm (publish-session-settings, set-session-setting request). - Tests: native end-to-end (open, click both rows, keyboard, Escape), a state.edn round trip that checks both settings take effect, and a host-wasm module test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hgxf6exeYrDGcy4WW3
This commit is contained in:
32 files changed
+1192
-44
No files matched your search
@@ -126,3 +126,14 @@ interface wallpaper {
|
||||
/// Show wallpaper `index` (out-of-range indices are ignored). The choice is remembered.
|
||||
set-wallpaper: func(index: u32);
|
||||
}
|
||||
|
||||
/// Session settings: how the login session starts and what it remembers. The shell keeps them in
|
||||
/// state.edn; a module with this capability lists them as on/off switches and flips them.
|
||||
interface session-settings {
|
||||
/// Display names, indexed by setting.
|
||||
settings: func() -> list<string>;
|
||||
/// Whether setting `index` is on (false for an out-of-range index).
|
||||
is-on: func(index: u32) -> bool;
|
||||
/// Turn setting `index` on or off (out-of-range indices are ignored). The choice is remembered.
|
||||
set-setting: func(index: u32, on: bool);
|
||||
}
|
||||
+10
-1
@@ -40,12 +40,14 @@ interface plasmoids {
|
||||
/// Row tables, as built by compositor/wasm: a LE u32 row count, then per row each field as a LE
|
||||
/// i32 ('i') or a LE u32 byte length + UTF-8 ('s'). `which`: 0 apps (sssss: id name comment
|
||||
/// category glyph), 1 windows (isii: id title focused minimized), 2 layouts (s), 3 modules
|
||||
/// (sssi: id name path loaded), 4 instances (sss: slot module name), 5 wallpapers (s).
|
||||
/// (sssi: id name path loaded), 4 instances (sss: slot module name), 5 wallpapers (s), 6 session settings (s).
|
||||
publish-table: func(which: u32, rows: list<u8>);
|
||||
/// Layout mode (0 tiling, 1 monocle, 2 floating) and whether the Interface Explorer is on.
|
||||
publish-state: func(layout-mode: s32, inspector-on: bool);
|
||||
/// The wallpaper on the desktop now (an index into the wallpapers table).
|
||||
publish-wallpaper: func(current: s32);
|
||||
/// Which session settings are on: bit i for row i of the session settings table.
|
||||
publish-session-settings: func(on: u32);
|
||||
|
||||
record system-snapshot {
|
||||
cpu-permille: u32,
|
||||
@@ -68,6 +70,12 @@ interface plasmoids {
|
||||
}
|
||||
publish-windows: func(wins: list<window-entry>);
|
||||
|
||||
/// A module turning a session setting on or off.
|
||||
record setting-change {
|
||||
index: s32,
|
||||
on: bool,
|
||||
}
|
||||
|
||||
// ---- what modules asked of the host ----
|
||||
|
||||
variant request {
|
||||
@@ -80,6 +88,7 @@ interface plasmoids {
|
||||
browse,
|
||||
logout,
|
||||
set-wallpaper(s32),
|
||||
set-session-setting(setting-change),
|
||||
}
|
||||
/// The next pending request, oldest first.
|
||||
next-request: func() -> option<request>;
|
||||
|
||||
@@ -75,6 +75,7 @@ world plasmoid-host {
|
||||
import system;
|
||||
import session;
|
||||
import wallpaper;
|
||||
import session-settings;
|
||||
export plasmoid;
|
||||
}
|
||||
|
||||
@@ -89,3 +90,9 @@ world wallpaper-widget {
|
||||
include widget;
|
||||
import wallpaper;
|
||||
}
|
||||
|
||||
/// Session settings switches.
|
||||
world session-settings-widget {
|
||||
include widget;
|
||||
import session-settings;
|
||||
}
|
||||
Reference in new issue
Block a user