Kiosk mode: --kiosk CMD runs one fullscreen app, locked down, restarted when it exits
CI / test (push) Successful in 4m10s
CI / test (push) Successful in 4m10s
No panel, no compositor shortcuts or desktop menus, the focused window fullscreen (dialogs float), CMD restarted with backoff. Ctrl+Alt+Shift+Escape or chandra-ctl kiosk lock|unlock|status for admin work. --app-id sets the X11 WM_CLASS / Wayland app id of Chandra's own window. scripts/gamerig-kiosk.sh runs Chandra as a gamerig rig's library window on its NVIDIA Xorg. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
This commit is contained in:
11 files changed
+635
-16
No files matched your search
@@ -184,6 +184,8 @@ pub(all) struct ChandraCompositor {
|
||||
mut rec_pointer : Bool
|
||||
mut rec_press : Bool
|
||||
mut last_recording : String
|
||||
/// `--kiosk`: one fullscreen app, locked down (kiosk.mbt). None: a normal desktop.
|
||||
mut kiosk : Kiosk?
|
||||
/// Chandra's polkit agent (auth.mbt), while it is registered; the system bus socket it uses
|
||||
/// ("" finds it); the dialog while it is up; key releases it swallows; how to reach polkit's
|
||||
/// helper (empty: the usual routes; tests set their own); the keymap typing goes through.
|
||||
@@ -306,6 +308,7 @@ pub fn ChandraCompositor::new(
|
||||
rec_pointer: true,
|
||||
rec_press: false,
|
||||
last_recording: "",
|
||||
kiosk: None,
|
||||
}
|
||||
// Client popups (menus) are placed to stay on screen: the server asks for the output's
|
||||
// rectangle relative to the parent's content origin when it applies constraint adjustment.
|
||||
@@ -317,7 +320,11 @@ pub fn ChandraCompositor::new(
|
||||
}
|
||||
|
||||
///| The part of a `w` x `h` output windows are laid out in.
|
||||
fn work_area_for(w : Int, h : Int, theme : @scene.ThemeTokens) -> @wm.Rect {
|
||||
fn work_area_for(w : Int, h : Int, theme : @scene.ThemeTokens, kiosk~ : Bool = false) -> @wm.Rect {
|
||||
if kiosk {
|
||||
// A locked kiosk has no panel and its windows are fullscreen: the whole output.
|
||||
return { x: 0, y: 0, w, h }
|
||||
}
|
||||
@wm.compute_work_area(
|
||||
{ x: 0, y: 0, w, h },
|
||||
excl_top=32, // room for the server-side title bar drawn above each client
|
||||
@@ -333,7 +340,7 @@ pub fn ChandraCompositor::resize(self : ChandraCompositor, w : Int, h : Int) ->
|
||||
}
|
||||
self.output_w = w
|
||||
self.output_h = h
|
||||
self.work_area = work_area_for(w, h, self.theme)
|
||||
self.work_area = work_area_for(w, h, self.theme, kiosk=self.kiosk_locked())
|
||||
self.close_overlay() // its frozen frame is the old size
|
||||
self.stop_recording()
|
||||
self.server.set_output_size(w, h)
|
||||
@@ -468,6 +475,7 @@ fn ChandraCompositor::configure_window(self : ChandraCompositor, win : HostWindo
|
||||
///|
|
||||
pub fn ChandraCompositor::step(self : ChandraCompositor) -> Unit {
|
||||
self.flush_configures()
|
||||
self.kiosk_tick()
|
||||
self.portal_tick()
|
||||
self.auth_tick()
|
||||
self.control_tick()
|
||||
@@ -704,7 +712,8 @@ pub fn ChandraCompositor::has_timed_work(self : ChandraCompositor) -> Bool {
|
||||
self.thumbs_pending() ||
|
||||
self.overview_animating() ||
|
||||
self.shell.animating() ||
|
||||
self.shell.face_busy()
|
||||
self.shell.face_busy() ||
|
||||
self.kiosk_waiting()
|
||||
}
|
||||
|
||||
///| How long an idle main loop may sleep: `idle_ms` (until the wall clock's next second), or
|
||||
@@ -1713,12 +1722,12 @@ pub fn ChandraCompositor::handle_input(
|
||||
return
|
||||
}
|
||||
// Right button over a swappable panel widget opens its alternatives menu.
|
||||
if button == 273U && pressed && self.shell.right_click(xi, yi) {
|
||||
if button == 273U && pressed && !self.kiosk_locked() && self.shell.right_click(xi, yi) {
|
||||
return
|
||||
}
|
||||
// Right button on the empty desktop: the desktop menu (module settings, system settings).
|
||||
if button == 273U && pressed && self.window_at(xi, yi) is None && !self.shell.hit(xi, yi) &&
|
||||
self.shell.desktop_menu(xi, yi) {
|
||||
if button == 273U && pressed && !self.kiosk_locked() && self.window_at(xi, yi) is None &&
|
||||
!self.shell.hit(xi, yi) && self.shell.desktop_menu(xi, yi) {
|
||||
return
|
||||
}
|
||||
if pressed {
|
||||
@@ -1792,9 +1801,14 @@ pub fn ChandraCompositor::handle_input(
|
||||
}
|
||||
}
|
||||
Key(code, pressed) =>
|
||||
if self.switcher_key(code, pressed, time_ms) {
|
||||
if self.kiosk_key(code, pressed) {
|
||||
self.super_solo = false
|
||||
} else if self.shortcut_key(code, pressed) {
|
||||
} else if self.switcher_key(code, pressed, time_ms) {
|
||||
self.super_solo = false
|
||||
} else if !self.kiosk_locked() && self.shortcut_key(code, pressed) {
|
||||
self.super_solo = false
|
||||
} else if self.kiosk_locked() && (code == 125U || code == 126U) {
|
||||
// A locked kiosk: Super opens nothing and isn't passed on either.
|
||||
self.super_solo = false
|
||||
} else if code == 125U || code == 126U {
|
||||
// Super (left/right): a bare tap runs the shortcut bound to "Super" (the launcher by
|
||||
|
||||
Reference in new issue
Block a user