Task manager: right-click a window's pill for Minimize/Restore, Maximize, Quit
CI / test (push) Failing after 16s

- Right-clicking a pill in the task manager opens that window's menu (titled with the window's
  title): Minimize (Restore when minimized), Maximize (Restore size when maximized) and Quit,
  which asks the app to close the window (xdg_toplevel close, like the title-bar close button).
  Empty task-bar space keeps the module's own menu (Module settings, Replace with, Remove widget).
- Modules only get left clicks, so the shell draws the menu and hit-tests the pills itself: the
  pill geometry moved to lib/panel/tasks.mbt, shared by the tasks module and the shell. No WIT
  change, so every host works as before.
- New menu row kind 6 and ShellAction::Window(id, WindowCommand); the compositor runs it through
  the same WM requests as the title-bar buttons. WinInfo carries `maximized`.
- Tests: native end-to-end (menu rows, minimize/restore, maximize/restore size, Quit sends close,
  empty space keeps the module menu) and lib/panel pill geometry tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiX13fXK1eMboRe5oQ
This commit is contained in:
Claude committed 2026-11-25 20:13:38 +00:00
1 parent f33f84c35b
commit f844ac66ff
9 files changed
+238 -35

No files matched your search

+26 -2
View File
@@ -132,8 +132,21 @@ pub(all) struct WinInfo {
title : String
focused : Bool
minimized : Bool
/// Maximized (also while minimized: restoring brings it back maximized).
maximized : Bool
}
///| What the window menu of a task-bar pill asks for (`ShellAction::Window`).
pub(all) enum WindowCommand {
/// Ask the app to close the window (xdg_toplevel close; the app may still ask to save).
Close
Minimize
/// Un-minimize and focus.
Restore
/// Maximize, or bring a maximized window back to its size.
ToggleMaximize
} derive(Eq, Debug)
///| Something a panel module asked the compositor to do.
pub(all) enum ShellAction {
SetLayout(Int)
@@ -147,6 +160,8 @@ pub(all) enum ShellAction {
Screenshot(Int)
/// The settings module's Power tab asked to suspend (0), power off (1) or restart (2) now.
SystemPower(Int)
/// A row of a task-bar pill's right-click menu: do this to that window.
Window(UInt64, WindowCommand)
} derive(Eq, Debug)
///| One wasm module loaded into the panel.
@@ -176,7 +191,8 @@ pub(all) struct CatalogEntry {
///| One row of the right-click menu. `kind`: 0 replace with module `arg` (a path), 1 remove,
/// 2 open System settings, 3 open the module's own settings, 4 set the module's setting `arg` to
/// `value`, 5 a heading or note (not clickable).
/// `value`, 5 a heading or note (not clickable), 6 a window command (`window_cmd`) for the window
/// whose task-bar pill was right-clicked (`window_id`).
pub(all) struct MenuRow {
label : String
kind : Int
@@ -185,11 +201,19 @@ pub(all) struct MenuRow {
value : String
/// Draw a tick: the value a kind-4 row sets is the current one.
ticked : Bool
/// The window and command of a kind-6 row.
window_id : UInt64
window_cmd : WindowCommand
}
///| A plain menu row (no setting value, no tick).
fn menu_row(label : String, kind : Int, arg? : String = "") -> MenuRow {
{ label, kind, arg, value: "", ticked: false }
{ label, kind, arg, value: "", ticked: false, window_id: 0, window_cmd: Close }
}
///| A window-menu row: `cmd` for window `id`.
fn window_row(label : String, id : UInt64, cmd : WindowCommand) -> MenuRow {
{ label, kind: 6, arg: "", value: "", ticked: false, window_id: id, window_cmd: cmd }
}
///| The desktop shell: wallpaper + a bottom panel made entirely of wasm modules