Kiosk: --kiosk-hybrid keeps the desktop and locks only leaving the session
CI / test (push) Successful in 3m49s
CI / test (push) Successful in 3m49s
Panel, launcher, dock, desktop module and shortcuts stay; Log out and power actions are refused while locked. Admin escape and chandra-ctl kiosk work as in the strict kiosk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
This commit is contained in:
7 files changed
+115
-15
No files matched your search
@@ -169,3 +169,41 @@ test "chandra-ctl kiosk: status, unlock, lock; an error outside kiosk mode" {
|
||||
assert_eq(ask(comp, path, "kiosk bogus"), ["error usage: kiosk [lock|unlock|status]"])
|
||||
comp.close()
|
||||
}
|
||||
|
||||
///|
|
||||
test "a hybrid kiosk keeps the panel, the shortcuts and the layout; only leaving is refused" {
|
||||
let socket_path = "/tmp/wayland-moon-kioskh-" + @sys.getpid().to_string() + ".sock"
|
||||
let comp = @host.ChandraCompositor::new(socket_path, @scene.ThemeTokens::moon_night(), 1280, 720).unwrap()
|
||||
ignore(comp.compose_frame())
|
||||
comp.start_kiosk("", hybrid=true)
|
||||
assert_true(comp.kiosk_locked())
|
||||
assert_false(comp.kiosk_strict())
|
||||
let clients = open_windows(comp, socket_path, 2)
|
||||
for _i = 0; _i < 5; _i = _i + 1 {
|
||||
comp.step()
|
||||
}
|
||||
ignore(comp.compose_scene())
|
||||
// The panel is there and windows are tiled as usual, not fullscreen.
|
||||
assert_true(comp.shell.panel_rect.h > 0)
|
||||
for _, win in comp.windows {
|
||||
assert_false(win.fullscreen)
|
||||
assert_true(win.geometry.w < 1280)
|
||||
}
|
||||
// The launcher opens with the Super tap.
|
||||
kiosk_press(comp, [125U], 10U)
|
||||
assert_true(comp.shell.launcher_open())
|
||||
kiosk_press(comp, [1U], 12U)
|
||||
// Log out is refused while locked, and works once the admin unlocked it.
|
||||
comp.shell.actions.push(@shell.ShellAction::Logout)
|
||||
comp.damage.mark_full()
|
||||
ignore(comp.compose_scene())
|
||||
assert_false(comp.quit_requested)
|
||||
kiosk_escape(comp, 20U)
|
||||
assert_false(comp.kiosk_locked())
|
||||
comp.shell.actions.push(@shell.ShellAction::Logout)
|
||||
comp.damage.mark_full()
|
||||
ignore(comp.compose_scene())
|
||||
assert_true(comp.quit_requested)
|
||||
ignore(clients)
|
||||
comp.close()
|
||||
}
|
||||
Reference in new issue
Block a user