Desktop modules: a wasm module can fill the desktop, with Icon Desktop and Live Starfield
CI / test (push) Failing after 30s

A module that exports chandra:desktop/desktop-module (wit/desktop.wit) owns the desktop behind
the windows instead of a box in the panel: same sandbox, draw ops and capabilities, drawn at the
output's full size and re-rendered on resize. It gets pointer and scroll events only on the empty
desktop (windows, panel, popups and menus always win; a drag stays with the module until
release), keys only while the desktop has focus, and can draw over the wallpaper or replace it.
Its tick() asks for animation frames only while something moves; the main loop sleeps until the
next one (wake_timeout), and frames pause while a window covers the desktop, so an idle desktop
module costs nothing.

Settings > Desktop gets "On the desktop": Wallpaper only, Clock card (default) or any installed
desktop module, saved in state.edn as :desktop, loaded at login and reloaded by chandra-ctl
reload. Right-click the empty desktop for Module settings and System settings. Hidden settings
(empty label) are persisted by the shell, which is how Icon Desktop keeps icon positions.

Samples: Icon Desktop (click to launch, drag to arrange, keyboard navigation, count and size
settings) and Live Starfield (pointer steers, click or Space warps, wheel sets speed). Served by
all hosts: compositor/wasm (native + MoonBit wasmhost) and Rust host-wasm. Docs in
docs/desktop-modules.md; tests in compositor/host/desktop_test.mbt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgf1SwPMHVfLUbJKsB
This commit is contained in:
Claude committed 2026-11-26 00:30:32 +00:00
1 parent 30f5e88639
commit 0f71779819
79 files changed
+4591 -113

No files matched your search

+96 -3
View File
@@ -644,6 +644,37 @@ pub fn ChandraCompositor::has_timed_work(self : ChandraCompositor) -> Bool {
self.shell.animating()
}
///| How long an idle main loop may sleep: `idle_ms` (until the wall clock's next second), or
/// less when a desktop module's next animation frame is due sooner.
pub fn ChandraCompositor::wake_timeout(self : ChandraCompositor, idle_ms : Int) -> Int {
let d = self.shell.desktop_wake_ms(@sys.monotonic_ms())
if d >= 0 && d < idle_ms {
d
} else {
idle_ms
}
}
///| True when a window covers the whole work area (or the output), give or take the tiling gaps:
/// the desktop can't be seen.
fn ChandraCompositor::desktop_covered(self : ChandraCompositor) -> Bool {
let m = 16
let wa = self.work_area
let wa : @wm.Rect = { x: wa.x + m, y: wa.y + m, w: wa.w - 2 * m, h: wa.h - 2 * m }
for wid in self.wm.stacking_order() {
match self.windows.get(wid) {
Some(win) => {
let g = win.geometry
if g.x <= wa.x && g.y <= wa.y && g.x + g.w >= wa.x + wa.w && g.y + g.h >= wa.y + wa.h {
return true
}
}
None => ()
}
}
false
}
///|
pub fn ChandraCompositor::set_layout_mode(
self : ChandraCompositor,
@@ -769,6 +800,9 @@ fn ChandraCompositor::build_scene(
self.shell.win_list = entries
self.shell.screenshot_state = (if self.rec is Some(_) { 1 } else { 0 }) |
(if self.rec_pointer { 2 } else { 0 })
// A window over the whole desktop (maximized, fullscreen, monocle) pauses a desktop module's
// animation: nobody can see it.
self.shell.set_desktop_covered(self.desktop_covered())
let t0 = @sys.monotonic_ms()
let (bg_ops, shell_ops) = self.shell.render(self.output_w, self.output_h, self.theme)
// The overview goes under the panel and the launcher.
@@ -1030,6 +1064,7 @@ fn ChandraCompositor::set_kbd_focus(self : ChandraCompositor, wid : UInt64?) ->
self.kbd_win = wid
match wid {
Some(w) => {
self.shell.desktop_unfocus() // a window has the keyboard now, not the desktop
self.server.keyboard_enter(w)
self.server.keyboard_modifiers(w, self.mods, 0U, 0U, 0U)
}
@@ -1330,6 +1365,12 @@ fn key_name(code : UInt, shift : Bool) -> String {
28U => "Enter"
57U => " "
12U => "-"
13U => if shift { "+" } else { "=" }
15U => "Tab"
103U => "ArrowUp"
108U => "ArrowDown"
105U => "ArrowLeft"
106U => "ArrowRight"
52U => "."
53U => "/"
_ => ""
@@ -1411,8 +1452,16 @@ pub fn ChandraCompositor::handle_input(
}
return
}
if self.shell.desktop_grabbing() {
// A press on the desktop is held (an icon being dragged): the desktop module follows the
// pointer wherever it goes until the release.
self.leave_pointer()
ignore(self.shell.desktop_pointer_move(xi, yi))
return
}
if self.shell.pointer_move(xi, yi) || self.shell.hit(xi, yi) {
self.leave_pointer()
self.shell.desktop_leave()
return
}
match self.split_drag {
@@ -1424,10 +1473,12 @@ pub fn ChandraCompositor::handle_input(
}
if self.handle_at(xi, yi) is Some(_) || self.resize_at(xi, yi) is Some(_) {
self.leave_pointer()
self.shell.desktop_leave()
return
}
match self.window_at(xi, yi) {
Some((wid, true)) =>
Some((wid, true)) => {
self.shell.desktop_leave()
match self.windows.get(wid) {
Some(win) => {
let lx = x - win.geometry.x.to_double()
@@ -1441,7 +1492,16 @@ pub fn ChandraCompositor::handle_input(
}
None => ()
}
_ => self.leave_pointer()
}
Some((_, false)) => {
self.leave_pointer()
self.shell.desktop_leave()
}
None => {
// The empty desktop: a desktop module sees the pointer here.
self.leave_pointer()
ignore(self.shell.desktop_pointer_move(xi, yi))
}
}
}
Scroll(axis, v, discrete) => {
@@ -1488,7 +1548,15 @@ pub fn ChandraCompositor::handle_input(
}
None => ()
}
_ => ()
Some((_, false)) => ()
None =>
if !self.shell.hit(xi, yi) {
// The empty desktop: a desktop module gets the wheel (in pixels; a notch is ~10).
let d = if v != 0.0 { v.to_int() } else { discrete * 10 }
ignore(
self.shell.desktop_scroll(xi, yi, if axis == 1U { d } else { 0 }, if axis == 0U { d } else { 0 }),
)
}
}
}
PointerButton(button, pressed) => {
@@ -1527,6 +1595,10 @@ pub fn ChandraCompositor::handle_input(
self.run_shell_actions()
return
}
if !pressed && self.shell.desktop_release(xi, yi) {
self.run_shell_actions()
return
}
if !pressed && self.split_drag is Some(_) {
self.split_drag = None
return
@@ -1549,6 +1621,11 @@ pub fn ChandraCompositor::handle_input(
if button == 273U && pressed && 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) {
return
}
if pressed {
self.super_solo = false
if button != 273U && self.shell.pointer_down(xi, yi) {
@@ -1593,6 +1670,13 @@ pub fn ChandraCompositor::handle_input(
self.leave_pointer()
return
}
// A left press on the empty desktop: a desktop module gets it, and the keyboard.
if button == 272U && self.window_at(xi, yi) is None && self.shell.desktop_press(xi, yi) {
self.leave_pointer()
self.set_kbd_focus(None)
self.run_shell_actions()
return
}
match self.window_at(xi, yi) {
Some((wid, _)) => {
self.activate_window(wid)
@@ -1642,6 +1726,15 @@ pub fn ChandraCompositor::handle_input(
self.shell.key_down(name)
}
}
} else if self.kbd_win is None && self.shell.desktop_has_focus() {
// The desktop has the keyboard (it was clicked): keys go to the desktop module.
self.super_solo = false
if pressed {
let name = key_name(code, (self.mods & 1U) != 0U)
if name.length() > 0 && self.shell.desktop_key(name) {
self.run_shell_actions()
}
}
} else {
self.super_solo = false
match self.kbd_win {
+300
View File
@@ -0,0 +1,300 @@
///| Desktop modules (wit/desktop.wit, compositor/shell/desktop_module.mbt): a module that fills the
/// desktop behind the windows. Needs the sample modules built: scripts/build-modules.sh.
///| A compositor with a first frame drawn and six made-up apps (so icon positions don't depend on
/// the machine's .desktop files).
fn desk_comp(tag : String, fake_apps? : Bool = true) -> @host.ChandraCompositor {
let socket_path = "/tmp/wayland-moon-desk-" + tag + "-" + @sys.getpid().to_string() + ".sock"
let comp = @host.ChandraCompositor::new(socket_path, @scene.ThemeTokens::moon_night(), 1280, 720).unwrap()
if fake_apps {
comp.shell.apps.clear()
for i = 0; i < 6; i = i + 1 {
comp.shell.apps.push({
id: "app" + i.to_string(),
name: ["Files", "Browser", "Terminal", "Editor", "Mail", "Music"][i],
comment: "",
category: "",
glyph: "",
})
}
comp.shell.apps_dirty = true
}
ignore(comp.compose_frame())
comp
}
///|
fn desk_socket(tag : String) -> String {
"/tmp/wayland-moon-desk-" + tag + "-" + @sys.getpid().to_string() + ".sock"
}
///| Press at (x0, y0), move to (x1, y1) in steps, release there.
fn desk_drag(comp : @host.ChandraCompositor, x0 : Int, y0 : Int, x1 : Int, y1 : Int, t : UInt) -> Unit {
comp.handle_input(@nested.InputEvent::PointerMove(x0.to_double(), y0.to_double()), t)
comp.handle_input(@nested.InputEvent::PointerButton(272U, true), t + 1U)
for k = 1; k <= 4; k = k + 1 {
let x = x0 + (x1 - x0) * k / 4
let y = y0 + (y1 - y0) * k / 4
comp.handle_input(@nested.InputEvent::PointerMove(x.to_double(), y.to_double()), t + 2U + k.reinterpret_as_uint())
}
comp.handle_input(@nested.InputEvent::PointerButton(272U, false), t + 10U)
ignore(comp.compose_frame())
}
///| The value of the desktop module's setting `key` ("" when none).
fn desk_setting(comp : @host.ChandraCompositor, key : String) -> String {
for it in comp.shell.slot_config("desktop") {
if it.key == key {
return it.value
}
}
""
}
///| Whether the desktop module currently draws a focused selection (an outlined icon cell).
fn desk_selection_outlined(comp : @host.ChandraCompositor) -> Bool {
comp.shell.slot_ops("desktop").iter().any(op => op is StrokeRect(_))
}
///|
test "Settings > Desktop lists the desktop modules, and only the desktop takes them" {
let comp = desk_comp("choose")
let mods = comp.shell.desktop_modules()
assert_true(mods.contains(("icon-desktop", "Icon Desktop")))
assert_true(mods.contains(("starfield", "Live Starfield")))
// A desktop module is not a panel module, and the other way round.
assert_true(comp.shell.load_path("build/components/starfield.wasm") is None)
assert_false(comp.shell.set_desktop("launcher"))
assert_eq(comp.shell.desktop_choice(), "clock-card")
assert_true(comp.shell.desktop_module() is None)
// Choose one: it is loaded under the "desktop" slot (chandra-ctl list shows it last).
assert_true(comp.shell.set_desktop("icon-desktop"))
assert_eq(comp.shell.desktop_choice(), "icon-desktop")
let last = comp.shell.loaded_modules().last().unwrap()
assert_eq((last.0, last.1), ("desktop", "icon-desktop"))
// Another replaces it; the wallpaper alone unloads it.
assert_true(comp.shell.set_desktop("starfield"))
assert_eq(comp.shell.desktop_module().unwrap().module_id, "starfield")
assert_true(comp.shell.set_desktop("wallpaper"))
assert_true(comp.shell.desktop_module() is None)
// The built-in clock card can only be dragged while it is on the desktop.
assert_false(comp.shell.desk_hit(1280 - 100, 60))
assert_true(comp.shell.set_desktop("clock-card"))
assert_true(comp.shell.desk_hit(1280 - 100, 60))
}
///|
test "the empty desktop's pointer and keys reach the desktop module" {
let comp = desk_comp("input")
assert_true(comp.shell.set_desktop("icon-desktop"))
ignore(comp.compose_frame())
// Grid cells are 96 px from (20, 20): app0 at (0,0), app1 below it.
click_at(comp, 900, 300, 10U) // empty desktop, no icon there
assert_true(comp.shell.desktop_has_focus())
assert_false(desk_selection_outlined(comp))
// Arrow keys move the selection (drawn outlined while the desktop has the keyboard).
comp.handle_input(@nested.InputEvent::Key(108U, true), 20U) // Down
comp.handle_input(@nested.InputEvent::Key(108U, false), 21U)
ignore(comp.compose_frame())
assert_true(desk_selection_outlined(comp))
// Drag app0 to the cell at column 5, row 2: the arrangement is saved as the hidden setting.
desk_drag(comp, 68, 68, 20 + 5 * 96 + 40, 20 + 2 * 96 + 40, 30U)
assert_true(desk_setting(comp, "places").contains("app0=5,2"))
assert_eq(comp.shell.module_setting("icon-desktop", "places"), Some(desk_setting(comp, "places")))
// The wheel over the empty desktop goes to the module too (the icon desktop ignores it).
comp.handle_input(@nested.InputEvent::PointerMove(900.0, 300.0), 50U)
comp.handle_input(@nested.InputEvent::Scroll(0U, 10.0, 1), 51U)
assert_true(comp.shell.desktop_has_focus())
}
///|
test "windows and the panel win over the desktop module" {
let comp = desk_comp("hit")
assert_true(comp.shell.set_desktop("icon-desktop"))
ignore(comp.compose_frame())
// The panel: a click on a panel module doesn't reach the desktop.
let p = comp.shell.panel_rect
click_at(comp, p.x + p.w / 2, p.y + p.h / 2, 10U)
assert_false(comp.shell.desktop_has_focus())
assert_false(comp.shell.desktop_grabbing())
// A right-click on the panel opens the panel's menu, not the desktop's.
click_at(comp, p.x + p.w - 3, p.y + p.h / 2, 20U, btn=273U)
assert_true(comp.shell.menu_title != "Icon Desktop")
comp.shell.key_down("Escape")
// A window over the desktop (tiled: it fills the work area) takes clicks and keys.
let (_c, _shm, _surf, _xdg, _tl, _deco) = open_and_configure_client(comp, desk_socket("hit"), "Win", "test.win")
ignore(comp.compose_frame())
click_at(comp, 68, 68, 30U) // where app0's icon is, under the window
assert_false(comp.shell.desktop_has_focus())
assert_false(comp.shell.desktop_grabbing())
assert_eq(desk_setting(comp, "places"), "")
// No desktop menu over the window either.
click_at(comp, 68, 68, 40U, btn=273U)
assert_false(comp.shell.menu_open && comp.shell.menu_title == "Icon Desktop")
}
///|
test "a press on the desktop keeps the pointer until the release, even over a window" {
let comp = desk_comp("grab")
assert_true(comp.shell.set_desktop("icon-desktop"))
ignore(comp.compose_frame())
comp.handle_input(@nested.InputEvent::PointerMove(68.0, 68.0), 10U)
comp.handle_input(@nested.InputEvent::PointerButton(272U, true), 11U)
assert_true(comp.shell.desktop_grabbing())
comp.handle_input(@nested.InputEvent::PointerMove(1200.0, 600.0), 12U)
comp.handle_input(@nested.InputEvent::PointerButton(272U, false), 13U)
assert_false(comp.shell.desktop_grabbing())
}
///|
test "right-click on the empty desktop opens the desktop menu" {
let comp = desk_comp("menu")
// No module: just System settings (on the Desktop tab).
click_at(comp, 600, 300, 10U, btn=273U)
assert_true(comp.shell.menu_open)
assert_eq(comp.shell.menu_title, "Desktop")
assert_eq(comp.shell.menu_rows.map(r => r.label), ["System settings..."])
comp.shell.key_down("Escape")
assert_true(comp.shell.set_desktop("starfield"))
click_at(comp, 600, 300, 20U, btn=273U)
assert_eq(comp.shell.menu_title, "Live Starfield")
assert_eq(comp.shell.menu_rows.map(r => r.label), ["Module settings...", "System settings..."])
// It opens at the pointer, not above the panel.
let m = comp.shell.menu_rect
assert_eq((m.x, m.y), (600, 300))
// Module settings: the module's own choices; picking one applies it.
click_at(comp, m.x + 20, m.y + 26 + 14, 30U)
assert_eq(comp.shell.menu_title, "Live Starfield settings")
assert_true(comp.shell.menu_rows.map(r => r.label).contains("Still"))
comp.shell.set_module_setting("desktop", "speed", "Fast")
assert_eq(desk_setting(comp, "speed"), "Fast")
ignore(@sys.write_file_bytes("_build/desktop_menu.png", @renderer.encode_png(comp.compose_frame())))
comp.shell.key_down("Escape")
// System settings opens the settings module on its Desktop tab, listing the choices.
click_at(comp, 600, 300, 40U, btn=273U)
let m = comp.shell.menu_rect
click_at(comp, m.x + 20, m.y + 26 + 28 + 14, 50U)
let slot = comp.shell.slot_of("session-settings")
let texts = comp.shell.slot_popup_texts(slot).map(t => t.0)
assert_true(texts.contains("On the desktop"))
assert_true(texts.contains("Live Starfield"))
assert_true(texts.contains("Icon Desktop"))
assert_true(texts.contains("Clock card"))
}
///|
test "the desktop module is drawn at the output's size, and again after a resize" {
let comp = desk_comp("resize")
assert_true(comp.shell.set_desktop("starfield"))
let f = comp.compose_frame()
assert_eq(comp.shell.desktop_module().unwrap().rect.w, 1280)
// It replaces the wallpaper: deep space in the corner, darker than any wallpaper's.
let dark = fn(px : @scene.Rgba?) {
match px {
Some(c) => c.r.to_int() + c.g.to_int() + c.b.to_int() < 120
None => false
}
}
assert_true(dark(f.pixel(3, 3)))
comp.resize(1600, 900)
let f = comp.compose_frame()
assert_eq(f.width, 1600)
let d = comp.shell.desktop_module().unwrap()
assert_eq((d.rect.w, d.rect.h), (1600, 900))
assert_true(dark(f.pixel(1595, 5)))
match comp.shell.slot_ops("desktop")[0] {
FillRect(r) => assert_eq(r.rect.w, 1600U)
_ => fail("the starfield starts with its background")
}
}
///|
test "a still desktop module lets the main loop sleep; an animated one sets its pace" {
let comp = desk_comp("idle")
assert_true(comp.shell.set_desktop("icon-desktop"))
ignore(comp.compose_frame())
ignore(comp.compose_frame())
// The icon desktop never animates: nothing keeps the loop awake, frames are unchanged.
assert_false(comp.shell.desktop_animating())
assert_false(comp.has_timed_work())
assert_eq(comp.wake_timeout(980), 980)
ignore(comp.compose_frame())
assert_false(comp.frame_changed)
// The starfield asks for a frame every 33 ms: the idle sleep is cut to that, and each due
// frame is a changed one.
assert_true(comp.shell.set_desktop("starfield"))
ignore(comp.compose_frame())
assert_true(comp.shell.desktop_animating())
let t = comp.wake_timeout(980)
assert_true(t >= 0 && t <= 33)
@sys.sleep_ms(40)
ignore(comp.compose_frame())
assert_true(comp.frame_changed)
// Still: it stops asking, and the loop sleeps until the next second again.
comp.shell.set_module_setting("desktop", "motion", "Still")
@sys.sleep_ms(40)
ignore(comp.compose_frame())
ignore(comp.compose_frame())
assert_false(comp.shell.desktop_animating())
assert_eq(comp.wake_timeout(980), 980)
ignore(comp.compose_frame())
assert_false(comp.frame_changed)
// Moving again, but a window covering the desktop pauses it.
comp.shell.set_module_setting("desktop", "motion", "Moving")
assert_true(comp.shell.desktop_animating())
let (_c, _shm, _surf, _xdg, _tl, _deco) = open_and_configure_client(comp, desk_socket("idle"), "Cover", "test.cover")
ignore(comp.compose_frame())
assert_eq(comp.wake_timeout(980), 980)
}
///|
test "reload brings the desktop module back from disk with its settings" {
let comp = desk_comp("reload")
assert_true(comp.shell.set_desktop("starfield"))
comp.shell.set_module_setting("desktop", "speed", "Fast")
let (lines, ok) = comp.shell.reload_modules("starfield")
assert_true(ok)
assert_eq(lines, ["reloaded desktop starfield"])
assert_eq(desk_setting(comp, "speed"), "Fast")
// `reload` with no name reloads it along with the panel; `reload desktop` names it.
let (all, ok) = comp.shell.reload_modules("")
assert_true(ok)
assert_true(all.contains("reloaded desktop starfield"))
assert_eq(comp.shell.reload_modules("desktop").0, ["reloaded desktop starfield"])
assert_eq(comp.shell.desktop_module().unwrap().module_id, "starfield")
}
///|
test "desktop screenshots: icons, starfield, the Desktop tab" {
let comp = desk_comp("shots", fake_apps=false)
assert_true(comp.shell.set_desktop("icon-desktop"))
comp.shell.set_module_setting("desktop", "count", "All")
ignore(comp.compose_frame())
// Hover one icon and select another with the keyboard.
click_at(comp, 900, 300, 10U)
comp.handle_input(@nested.InputEvent::Key(106U, true), 20U) // Right: selects the first
comp.handle_input(@nested.InputEvent::Key(108U, true), 21U) // Down
comp.handle_input(@nested.InputEvent::PointerMove(68.0, 68.0), 22U)
ignore(@sys.write_file_bytes("_build/desktop_icons.png", @renderer.encode_png(comp.compose_frame())))
assert_true(comp.shell.set_desktop("starfield"))
comp.shell.set_module_setting("desktop", "speed", "Normal")
comp.handle_input(@nested.InputEvent::PointerMove(900.0, 250.0), 30U)
for _ in 0..<6 {
@sys.sleep_ms(34)
ignore(comp.compose_frame())
}
ignore(@sys.write_file_bytes("_build/desktop_starfield.png", @renderer.encode_png(comp.compose_frame())))
// Warp pulse: a click streaks the stars.
click_at(comp, 900, 250, 40U)
for _ in 0..<3 {
@sys.sleep_ms(34)
ignore(comp.compose_frame())
}
ignore(@sys.write_file_bytes("_build/desktop_warp.png", @renderer.encode_png(comp.compose_frame())))
assert_true(comp.shell.open_settings(Desktop))
for _ in 0..<10 {
@sys.sleep_ms(40) // the popup slides in
ignore(comp.compose_frame())
}
ignore(@sys.write_file_bytes("_build/desktop_settings.png", @renderer.encode_png(comp.compose_frame())))
}
+12 -3
View File
@@ -1472,13 +1472,20 @@ test "the settings module lists the wallpapers and switches the desktop to the o
let pr = comp.shell.slot_popup_rect(slot)
assert_true(pr.h >= 40 + 6 * 28) // heading and one row per wallpaper below the tab bar
assert_eq(comp.shell.wallpaper_sel, 0)
// The wallpaper rows follow what fills the desktop (wallpaper only, clock card, modules).
let row_y = fn(name : String) {
match comp.shell.slot_popup_texts(slot).iter().find_first(t => t.0 == name) {
Some(t) => pr.y + t.2
None => -1
}
}
// Third wallpaper: Starfield. The list stays open and the backdrop is drawn anew.
let star = click_wallpaper_ops(comp, pr.x + 40, pr.y + 40 + 3 * 28 + 13, 5U)
let star = click_wallpaper_ops(comp, pr.x + 40, row_y("Starfield"), 5U)
assert_eq(comp.shell.wallpaper_sel, 2)
assert_true(star > 0)
assert_true(comp.shell.slot_popup_rect(slot).w > 0)
// Last row: Solid, a single fill. Escape then closes the list.
assert_eq(click_wallpaper_ops(comp, pr.x + 40, pr.y + 40 + 5 * 28 + 13, 10U), 1)
assert_eq(click_wallpaper_ops(comp, pr.x + 40, row_y("Solid"), 10U), 1)
assert_eq(comp.shell.wallpaper_sel, 4)
comp.shell.key_down("Escape")
ignore(comp.compose_frame())
@@ -1682,7 +1689,9 @@ test "open_settings opens the settings module on the tab asked for" {
assert_true(comp.shell.open_settings(Desktop))
ignore(comp.compose_frame())
let pr = comp.shell.slot_popup_rect(slot)
assert_eq(pr.h, 40 + 6 * 28 + 6) // the Wallpaper heading and the five wallpapers
// "On the desktop" and its choices (wallpaper only, clock card, the two desktop modules), then
// the Wallpaper heading and the five wallpapers.
assert_eq(pr.h, 40 + (1 + 4 + 6) * 28 + 6)
assert_true(comp.shell.open_settings(Session))
ignore(comp.compose_frame())
assert_eq(comp.shell.slot_popup_rect(slot).h, 40 + 4 * 28 + 6) // the four settings