Dock and task manager are one module: titled window pills, pins, Super+1..9
CI / test (push) Failing after 30s

The panel had a task list and, beside it, a dock showing the same running
apps again. They are now one module, the dock, in the task list's place:

- Pinned apps, then running ones; an app with windows is a pill with its
  window's title (or name and window count) while there is room, an icon
  when the panel is crowded ("Show window titles" in Dock settings).
- Its right-click menu has the task list's window commands (Minimize /
  Restore, Maximize) for a single window, or the app's windows by title.
- It stretches like the task list did; new panels get it instead of
  tasks. A saved panel's "tasks" becomes the dock (one dock, where the
  task list was); pins are the dock's own setting, so they carry over.
- An empty dock shows a "+ Add apps" tile that opens the Applications
  menu, where right-clicking an app offers Open and Pin to dock (adding a
  dock to the panel if there is none).
- Super+1 .. Super+9 open the dock's first nine apps like a click
  (shortcut "dock-apps", rebindable in Settings > Shortcuts).
- "New window" / "Open" only for apps the catalog can start.

The tasks component, lib/panel's pill geometry and the taskbar-widget
world are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiPCFHRxaJQvwex6ry
This commit is contained in:
Claude committed 2026-11-26 00:08:05 +00:00
1 parent 42aa770452
commit 6253371cb3
28 files changed
+801 -1131

No files matched your search

+34 -27
View File
@@ -262,8 +262,11 @@ test "title-bar buttons minimize, maximize and close windows" {
click(btn(1UL, 1), 20U)
assert_true(comp.wm.windows.get(1UL).unwrap().minimized)
assert_true(!comp.wm.stacking_order().contains(1UL))
let tasks = rect_of(comp, "tasks")
// pills are in opening order (140 wide, 6 apart): window 1, the minimized one, is first
// The dock with nothing pinned: one titled pill per app, in opening order (150 wide, 6 apart):
// window 1's app, the minimized one, is first.
comp.shell.set_module_setting(comp.shell.slot_of("dock"), "pinned", ";")
ignore(comp.compose_frame())
let tasks = rect_of(comp, "dock")
click((tasks.x + 20, tasks.y + tasks.h / 2), 30U)
assert_true(!comp.wm.windows.get(1UL).unwrap().minimized)
// Close window 2: the client receives xdg_toplevel.close (opcode 1 on its toplevel).
@@ -277,7 +280,7 @@ test "title-bar buttons minimize, maximize and close windows" {
}
///|
test "the task list module focuses the window whose pill is clicked" {
test "the dock focuses the window whose pill is clicked" {
let socket_path = "/tmp/wayland-moon-tasks-" +
@sys.getpid().to_string() +
".sock"
@@ -285,6 +288,7 @@ test "the task list module focuses the window whose pill is clicked" {
let comp = @host.ChandraCompositor::new(socket_path, theme, 1280, 720).unwrap()
let _a = open_and_configure_client(comp, socket_path, "A", "a")
let _b = open_and_configure_client(comp, socket_path, "B", "b")
comp.shell.set_module_setting(comp.shell.slot_of("dock"), "pinned", ";")
ignore(comp.compose_frame())
let focused = fn() {
let mut f = 0UL
@@ -295,18 +299,18 @@ test "the task list module focuses the window whose pill is clicked" {
}
f
}
let tasks = rect_of(comp, "tasks")
let tasks = rect_of(comp, "dock")
assert_true(tasks.w > 300) // the stretching module takes the free space
let first = comp.wm.stacking_order()[0]
click_at(comp, tasks.x + 20, tasks.y + tasks.h / 2, 1U) // pill 0
assert_eq(focused(), first)
let other = comp.wm.stacking_order()
click_at(comp, tasks.x + 146 + 20, tasks.y + tasks.h / 2, 10U) // pill 1
click_at(comp, tasks.x + 156 + 20, tasks.y + tasks.h / 2, 10U) // pill 1
assert_true(focused() != first || other.length() == 1)
}
///|
test "right-click a task-bar pill for the window's menu: Minimize, Maximize, Quit" {
test "right-click an app in the dock for its window's menu: Minimize, Maximize, Quit" {
let socket_path = "/tmp/wayland-moon-taskmenu-" +
@sys.getpid().to_string() +
".sock"
@@ -314,8 +318,9 @@ test "right-click a task-bar pill for the window's menu: Minimize, Maximize, Qui
let comp = @host.ChandraCompositor::new(socket_path, theme, 1280, 720).unwrap()
let (c, _shm, _surf, _xdg, tl, _deco) = open_and_configure_client(comp, socket_path, "A", "a")
let _b = open_and_configure_client(comp, socket_path, "B", "b")
comp.shell.set_module_setting(comp.shell.slot_of("dock"), "pinned", ";")
ignore(comp.compose_frame())
let tasks = rect_of(comp, "tasks")
let tasks = rect_of(comp, "dock")
let cy = tasks.y + tasks.h / 2
let labels = fn() { comp.shell.menu_rows.map(r => r.label) }
// Pick menu row `label` (rows: 26px title, then 28px each).
@@ -324,17 +329,17 @@ test "right-click a task-bar pill for the window's menu: Minimize, Maximize, Qui
let m = comp.shell.menu_rect
click_at(comp, m.x + m.w / 2, m.y + 26 + 28 * i + 14, t)
}
// Pill 0 is window 1 (opening order): its menu, titled with its title.
// Pill 0 is window 1's app (opening order): its menu, titled with the app's name.
click_at(comp, tasks.x + 20, cy, 1U, btn=273U)
assert_true(comp.shell.menu_open)
assert_eq(comp.shell.menu_title, "A")
assert_eq(labels(), ["Minimize", "Maximize", "Quit"])
assert_eq(comp.shell.menu_title, "a")
assert_eq(labels(), ["Pin to dock", "Minimize", "Maximize", "Quit", "Dock settings..."])
// Minimize, then the same pill's menu offers Restore, which brings it back.
pick("Minimize", 10U)
assert_true(!comp.shell.menu_open)
assert_true(comp.wm.windows.get(1UL).unwrap().minimized)
click_at(comp, tasks.x + 20, cy, 20U, btn=273U)
assert_eq(labels(), ["Restore", "Maximize", "Quit"])
assert_eq(labels(), ["Pin to dock", "Restore", "Maximize", "Quit", "Dock settings..."])
pick("Restore", 30U)
assert_true(!comp.wm.windows.get(1UL).unwrap().minimized)
// Maximize, then Restore size.
@@ -343,12 +348,12 @@ test "right-click a task-bar pill for the window's menu: Minimize, Maximize, Qui
pick("Maximize", 50U)
assert_true(comp.windows.get(1UL).unwrap().geometry.w > w0)
click_at(comp, tasks.x + 20, cy, 60U, btn=273U)
assert_eq(labels(), ["Minimize", "Restore size", "Quit"])
assert_eq(labels(), ["Pin to dock", "Minimize", "Restore size", "Quit", "Dock settings..."])
pick("Restore size", 70U)
assert_eq(comp.windows.get(1UL).unwrap().geometry.w, w0)
// Pill 1 is window 2.
click_at(comp, tasks.x + 146 + 20, cy, 80U, btn=273U)
assert_eq(comp.shell.menu_title, "B")
// Pill 1 is window 2's app.
click_at(comp, tasks.x + 156 + 20, cy, 80U, btn=273U)
assert_eq(comp.shell.menu_title, "b")
comp.handle_input(@nested.InputEvent::Key(1U, true), 85U) // Escape
assert_true(!comp.shell.menu_open)
// Quit asks the app to close its window (xdg_toplevel.close, opcode 1 on its toplevel).
@@ -360,9 +365,9 @@ test "right-click a task-bar pill for the window's menu: Minimize, Maximize, Qui
@sys.sleep_ms(2)
}
assert_true(has_msg(drain_msgs(c), tl, 1U))
// Empty task-bar space keeps the module's own menu.
// Empty dock space keeps the module's own menu.
click_at(comp, tasks.x + tasks.w - 10, cy, 110U, btn=273U)
assert_eq(comp.shell.menu_title, "Task Manager")
assert_eq(comp.shell.menu_title, "Dock")
assert_true(labels().contains("Remove widget"))
}
@@ -614,9 +619,9 @@ test "the wasm picker opens the settings module's Panel tab, which loads and unl
assert_true(texts.contains("Browse for a module file..."))
// The Add list leaves out what is already in the panel (but a clock can be added twice) and
// has no cryptic instance counts.
assert_eq(texts.filter(t => t == "Task Manager").length(), 1)
assert_eq(texts.filter(t => t == "Dock").length(), 1)
assert_false(texts.contains("x1"))
assert_true(texts.contains("Pinned apps, one click away")) // the Dock's description
assert_true(texts.contains("The time in binary")) // the Binary Clock's description
let loaded = comp.shell.slots().length()
assert_eq(comp.shell.slot_of("clock-binary"), "")
let by = row_y("Binary Clock", false)
@@ -930,25 +935,24 @@ test "the dock: pinned and running apps, window dots, the hover label and the pe
comp.shell.apps.clear()
for id in ["foot", "firefox", "gimp"] {
comp.shell.apps.push({ id, name: id.to_upper(), comment: "", category: "", glyph: "x" })
comp.shell.exec.set(id, id)
}
comp.shell.apps_dirty = true
assert_true(comp.shell.load_path("build/components/dock.wasm") is Some(_))
ignore(comp.compose_frame())
let slot = comp.shell.slots().filter(s => comp.shell.slot_module(s).contains("dock"))[0]
// The dock is in the default panel; icons only here (titled pills are the default).
let slot = comp.shell.slot_of("dock")
comp.shell.set_module_setting(slot, "titles", "off")
let pinned = fn() {
comp.shell.slot_config(slot).filter(it => it.key == "pinned")[0].value
}
// Nothing chosen yet: the catalog's first apps, saved so launches don't reorder them.
assert_eq(pinned(), "foot;firefox;gimp")
// The pinned list isn't a row of the dock's settings menu.
let w0 = comp.shell.slot_rect(slot).w
// A foot window joins foot's icon; an unknown app gets its own icon after the pinned ones.
let _a = open_and_configure_client(comp, socket_path, "Term", "foot")
let _b = open_and_configure_client(comp, socket_path, "Other", "zzz")
ignore(comp.compose_frame())
ignore(comp.compose_frame())
let r = comp.shell.slot_rect(slot)
assert_true(r.w > w0) // the dock grew for the running app
let cy = r.y + r.h / 2
let pitch = 24 + 6 // medium icons
let x_of = fn(i : Int) { r.x + 6 + i * pitch + 12 + (if i >= 3 { 11 } else { 0 }) }
@@ -968,7 +972,9 @@ test "the dock: pinned and running apps, window dots, the hover label and the pe
click_at(comp, x_of(0), cy, 10U, btn=273U)
assert_true(comp.shell.menu_open)
assert_eq(comp.shell.menu_title, "FOOT")
assert_eq(labels(), ["New window", "Unpin from dock", "Move right", "Quit", "Dock settings..."])
assert_eq(labels(), [
"New window", "Unpin from dock", "Move right", "Minimize", "Maximize", "Quit", "Dock settings...",
])
assert_eq(comp.shell.dock_hover_name(), "") // no label over the menu
pick("Move right", 20U)
assert_eq(pinned(), "firefox;foot;gimp")
@@ -983,7 +989,8 @@ test "the dock: pinned and running apps, window dots, the hover label and the pe
let x2 = r.x + 6 + 2 * pitch + 11 + 12
click_at(comp, x2, cy, 50U, btn=273U)
assert_eq(comp.shell.menu_title, "zzz")
assert_eq(labels(), ["New window", "Pin to dock", "Quit", "Dock settings..."])
// Not in the app catalog: nothing to start a new window with.
assert_eq(labels(), ["Pin to dock", "Minimize", "Maximize", "Quit", "Dock settings..."])
pick("Pin to dock", 60U)
assert_eq(pinned(), "foot;gimp;zzz")
// Dock settings: the visible settings only.
@@ -998,7 +1005,7 @@ test "the dock: pinned and running apps, window dots, the hover label and the pe
pick("Large", 90U)
comp.handle_input(@nested.InputEvent::Key(1U, true), 95U) // Escape
ignore(comp.compose_frame())
assert_true(comp.shell.slot_rect(slot).w > r.w) // bigger icons, wider dock
assert_eq(comp.shell.module_setting("dock", "icon-size"), Some("Large"))
// A left click on a running app's icon focuses its window.
let focused = fn() {
let mut f = 0UL