Skip to content

RediWM is a Wayland compositor written in Zig (OpenGL ES) that includes everything in one process

system monitor

oxydizer62d1dbd16c3a
diff --git a/TESTING.md b/TESTING.md
index dd24b2f..1656606 100644
--- a/TESTING.md
+++ b/TESTING.md
@@ -317,6 +317,18 @@ confirmation, cancellation and Settings portal preferences). The chooser can
also be launched with `rediwm-files --open`, `--save` or `--folder`; it returns
a JSON result on stdout.
+**System Monitor**: `zig build test-monitor` covers proc parsing, CPU and memory
+accounting, PID reuse, filtering/sorting, stable selection, history, real pidfd
+actions against disposable children, and worker pause/resume/cancellation.
+`python3 tests/system_monitor.py` covers shortcut launch and restore in both
+desktop modes, search, keyboard actions, named force-quit confirmation,
+disappearing targets, resize, live theme updates while paused, focus loss,
+minimize/restore and idle worker lifetime. Repeat with `REDIWM_TEST_SCALE=1.5`.
+The noninstalled preload fixture uses seccomp user notifications to permit
+signals only to recorded disposable child identities, and verifies that gate
+against an unlisted disposable child before exercising UI actions. These tests
+require Linux seccomp user notifications; production builds contain no hooks.
+
**Desktop, Files, Images**: `desktop_icons.py`, `desktop_damage.py`,
`zig build test-files-terminal` (Files units plus isolated Bash/PTY and real drawer tests;
also `python3 tests/files_terminal.py` after building; supports `REDIWM_TEST_SCALE=1.5`),
diff --git a/build.zig b/build.zig
index 0547002..9a780b7 100644
--- a/build.zig
+++ b/build.zig
@@ -46,7 +46,11 @@ pub fn build(b: *std.Build) void {
scanner.generate("wl_output", 4);
scanner.generate("wl_seat", 8);
scanner.generate("wl_data_device_manager", 3);
- scanner.generate("xdg_wm_base", 2);
+ scanner.generate("xdg_wm_base", 6);
+ scanner.addSystemProtocol("stable/viewporter/viewporter.xml");
+ scanner.generate("wp_viewporter", 1);
+ scanner.addSystemProtocol("staging/fractional-scale/fractional-scale-v1.xml");
+ scanner.generate("wp_fractional_scale_manager_v1", 1);
scanner.generate("zwp_tablet_manager_v2", 1);
scanner.generate("wp_cursor_shape_manager_v1", 2);
scanner.generate("ext_idle_notifier_v1", 1);
@@ -259,6 +263,23 @@ pub fn build(b: *std.Build) void {
files_step.dependOn(&install_images.step);
files_step.dependOn(&images_entry.step);
+ const monitor = b.addExecutable(.{
+ .name = "rediwm-monitor",
+ .root_module = b.createModule(.{ .root_source_file = b.path("src/system_monitor_main.zig"), .target = target, .optimize = optimize, .link_libc = true }),
+ .use_llvm = use_llvm,
+ .use_lld = use_llvm,
+ });
+ monitor.root_module.addImport("wayland", wayland);
+ inline for (.{ "wayland-client", "wayland-cursor", "xkbcommon" }) |lib| monitor.root_module.linkSystemLibrary(lib, .{});
+ const install_monitor = b.addInstallArtifact(monitor, .{});
+ const monitor_entry = b.addInstallFileWithDir(b.path("data/rediwm-monitor.desktop"), .prefix, "share/applications/rediwm-monitor.desktop");
+ const monitor_icon = b.addInstallFileWithDir(b.path("data/rediwm-monitor.svg"), .prefix, "share/icons/hicolor/scalable/apps/rediwm-monitor.svg");
+ const monitor_step = b.step("monitor", "Build the standalone System Monitor");
+ inline for (.{ &install_monitor.step, &monitor_entry.step, &monitor_icon.step }) |step| {
+ b.getInstallStep().dependOn(step);
+ monitor_step.dependOn(step);
+ }
+
const editor = b.addExecutable(.{
.name = "rediwm-editor",
.root_module = b.createModule(.{ .root_source_file = b.path("src/editor_main.zig"), .target = target, .optimize = optimize, .link_libc = true }),
@@ -487,6 +508,16 @@ pub fn build(b: *std.Build) void {
const run_ipc_tests = b.addRunArtifact(ipc_tests);
const test_step = b.step("test", "Run the project unit tests");
+ const monitor_tests = b.addTest(.{ .root_module = b.createModule(.{
+ .root_source_file = b.path("src/system_monitor_tests.zig"),
+ .target = target,
+ .optimize = optimize,
+ .link_libc = true,
+ }) });
+ const run_monitor_tests = b.addRunArtifact(monitor_tests);
+ const monitor_test_step = b.step("test-monitor", "Test System Monitor collection, process identity and model");
+ monitor_test_step.dependOn(&run_monitor_tests.step);
+ test_step.dependOn(&run_monitor_tests.step);
const printing_tests = b.addTest(.{ .root_module = b.createModule(.{
.root_source_file = b.path("src/printing/tests.zig"),
.target = target,
@@ -716,10 +747,10 @@ pub fn build(b: *std.Build) void {
test_step.dependOn(&run_ipc_tests.step);
// Hosts also rasterize app-specific content through their own C imports.
- inline for (.{ files.root_module, images.root_module, editor.root_module, pdf.root_module, share_picker.root_module, files_tests.root_module, images_tests.root_module, editor_tests.root_module, pdf_tests.root_module }) |module| {
+ inline for (.{ files.root_module, images.root_module, editor.root_module, pdf.root_module, share_picker.root_module, monitor.root_module, files_tests.root_module, images_tests.root_module, editor_tests.root_module, pdf_tests.root_module }) |module| {
inline for (.{ "cairo", "librsvg-2.0", "freetype2", "harfbuzz", "fontconfig" }) |lib| module.linkSystemLibrary(lib, .{});
}
- inline for (.{ compositor.root_module, ui_tests_module, files.root_module, images.root_module, editor.root_module, pdf.root_module, share_picker.root_module, editor_tests.root_module, images_tests.root_module, pdf_tests.root_module, files_tests.root_module, ipc_tests_module, protocol_mod, session_supervisor.root_module, session_tests.root_module, share_picker_tests.root_module, dbus_tests.root_module }) |module| {
+ inline for (.{ compositor.root_module, ui_tests_module, files.root_module, images.root_module, editor.root_module, pdf.root_module, share_picker.root_module, monitor.root_module, editor_tests.root_module, images_tests.root_module, pdf_tests.root_module, files_tests.root_module, ipc_tests_module, protocol_mod, session_supervisor.root_module, session_tests.root_module, share_picker_tests.root_module, dbus_tests.root_module }) |module| {
module.addImport("ui", ui_mod);
module.addImport("config", config_mod);
module.addImport("memory", memory_mod);
diff --git a/docs/files-terminal.md b/docs/files-terminal.md
deleted file mode 100644
index 75d079d..0000000
--- a/docs/files-terminal.md
+++ /dev/null
@@ -1,139 +0,0 @@
-# Files terminal
-
-F4 and the bottom-right terminal button toggle a drawer in normal Files
-windows. The sidebar keeps its full height. Drag the drawer's upper divider
-to resize it. Height is remembered; a new window always starts with the drawer
-hidden and creates a fresh shell only when opened. Choosers have no drawer.
-
-Opening focuses the terminal. Clicking the file list, toolbar or sidebar
-restores Files shortcuts. F4 works in either focus and never repeats; other
-keys, including Escape, Ctrl+C/D/Z, Alt combinations and key repeat, go to the
-terminal while focused. Modal dialogs take precedence and preserve focus.
-Ctrl+Shift+C/V copies or pastes. Drag to select; Shift selects locally when an
-application enables terminal mouse reporting. Wheel/scrollbar browse history;
-typing returns to the live screen. Shift+PageUp/PageDown scroll by a page.
-
-The drawer uses the configured monospace font, shared font fallback, app text
-size, terminal palette tokens and app foreground/background fallbacks. It
-uses the normal panel animation and reduced-motion setting. It reserves 48
-pixels for the file list (less the horizontal scrollbar) and needs at least
-96 pixels for its header and terminal. Very small windows temporarily hide
-it and return input to Files, retaining the shell and preferred height.
-
-## Shells and folder following
-
-The shell is a valid executable absolute `$SHELL`, otherwise the account's
-shell, otherwise `/bin/sh`. It is interactive, with a controlling PTY and
-normal job control. Bash loads its system startup configuration normally and
-the user's `~/.bashrc` through an anonymous, session-only rcfile. No startup
-file is changed. A private loadable builtin is loaded for this session only;
-if it cannot load, the shell remains usable without automatic following.
-Other shells use their normal interactive startup configuration.
-
-| Shell | Initial directory | Automatic following |
-| --- | --- | --- |
-| Bash | Current real folder | Session builtin; qualified on Bash 5.3 with Readline 8.3 |
-| Fish | Current real folder | Unavailable |
-| Zsh and other shells | Current real folder | Unavailable; not separately qualified |
-
-Bash following uses an inherited `SOCK_SEQPACKET` socket, separate from
-terminal output. Files accepts status only with the launched shell's kernel
-credentials. The shell checks its peer's credentials and makes its channel
-close-on-exec before sourcing the user's rcfile. There is no listening socket,
-polling timer, signal-as-command transport or synthetic `cd` text.
-
-The builtin waits for terminal input and the socket together at Readline's
-input hook. It applies the latest directory request only at a primary prompt,
-with an empty line and no search, completion, key sequence, macro or builtin
-read in progress. Paths are bounded data passed directly to Bash's `cd`
-builtin with `--`; quotes, newlines and Unicode are preserved. Bash validates
-the directory and maintains PWD/OLDPWD. Failed changes are acknowledged and
-displayed without restarting the shell. The user's prompt is re-expanded
-after a successful change; prompt commands and traps are preserved.
-
-While editing, running a command, inside a nested/remote shell or a
-multiplexer, following waits for the owned Bash prompt. Background jobs are
-reported too. Only the newest navigation request is retained. The header
-shows the shell's reported directory and whether following is pending or
-unavailable. Shell navigation never navigates Files. Recent, Trash and
-archive views retain the last real folder, falling back to Home.
-
-## Terminal contract and lifetime
-
-Files statically embeds upstream libvterm **0.3.3**, pinned by URL and Zig
-content hash in `build.zig.zon`. Distro libvterm packages are not used. GNU
-Readline development files build the Bash builtin; Bash's loadable-builtin
-loader rejects unavailable symbols. The installed helper and builtin are
-`bin/rediwm-files-terminal` and `lib/rediwm/files-bash.so`, beside the Files
-installation. The libvterm license is installed under `share/licenses/rediwm`.
-
-The advertised contract is `TERM=xterm-256color` with the distribution's
-ncurses xterm-256color terminfo, and `COLORTERM=truecolor`. Supported features
-include ANSI/256/RGB colours, bold, synthetic italic, underline, strike,
-reverse/conceal, cursor visibility/shapes, application cursor keys, alternate
-screen, bracketed paste, focus reporting and terminal mouse modes. Wide cells,
-combining characters (up to libvterm's six codepoints per cell) and font
-fallback are retained. Cursor and blinking text are steady: there is no blink
-timer. Graphics protocols, hyperlinks, desktop clipboard escape sequences and
-program-launch escape sequences are not exposed. In particular OSC 52 cannot
-read or write the Wayland clipboard, and OSC output cannot authorize following.
-
-Scrollback stores at most **4,096 physical rows and 8 MiB**, whichever comes
-first. Wrapped-row metadata controls selection copying. Resize clips/pads
-physical rows, without reflowing old history. Scrolled-back reading stays in
-place as output arrives, until the retained history limit evicts it. Selection
-is cleared on a column-count change. The grid is capped at 512 by 512 cells.
-
-PTY reads and writes have a **64 KiB budget per event-loop iteration**. Input
-has a **1 MiB** queue; larger/full-queue pastes are refused with a notice.
-Writes handle partial progress and EAGAIN, and request POLLOUT only while
-queued. Pasted ESC/control bytes are filtered to prevent terminating a
-bracketed paste; tabs and line endings are retained. Hidden sessions continue
-parsing with bounded history and add no paint or cursor timer wakeups.
-Allocator failures release the emulator's tracked allocations and fail that
-session without taking down Files.
-
-A fresh helper process performs PTY setup and exec; Files never runs unsafe
-library code in a forked child of its multithreaded process. On native login,
-the helper places the shell in a separate transient app.slice scope before
-executing startup files. Placement is best effort, like compositor app scopes.
-Nested/headless sessions skip it unless `REDIWM_APP_SCOPES=1` explicitly forces
-it. The compositor publishes its resolved setting to app clients through this
-existing flag, while continuing to strip private supervisor authority. PIDfds
-join the existing poll loop for exit notifications and reaping.
-
-Hiding keeps the session alive. After exit or failure the screen/error remains
-with a Restart action. Every live shell requires confirmation on Files close,
-including hidden sessions: an earlier status snapshot cannot prove no job has
-started since. Cancel preserves the session. Confirm sends hangup to this
-session, then uses bounded asynchronous cleanup and pidfds to kill/reap it if
-necessary. Remaining members of the owned PTY session are ended when its shell
-exits; intentionally detached `setsid` processes are independent. A Files crash
-closes its PTY with ordinary terminal hangup semantics; session survival is not
-promised.
-
-Open external terminal uses `[compositor] default_terminal`, preserving its
-desktop-entry arguments, theme handling, app scope and working directory.
-A missing preference falls back to `$TERMINAL` or `foot`. It creates an
-independent session in Files' current real folder; existing jobs stay in the
-drawer. Changing the default terminal affects only this external action.
-
-## Validation
-
-`zig build test-files-terminal` runs the Files units and an isolated headless
-suite with scratch HOME/XDG paths, disabled device enumeration, no host bus
-and no host app scopes. `REDIWM_TEST_SCALE=1.5` repeats at fractional scale.
-Unit fixtures cover chunked UTF-8/escape sequences, wide/combining cells,
-alternate screen, key/mouse/paste encoding, OSC policy, history bounds,
-allocator failures, preferences, viewport geometry, focus and chooser guards.
-The PTY fixture exercises empty/partial/busy prompts, coalescing, unusual paths,
-failed directory changes, nested shells, jobs, partial writes and full-screen
-tools. UI checks cover the held F4 toggle, keyboard input, hidden continuity,
-navigation, divider preferences, idle wakeups, independent windows and close.
-The drawer also stays live through workspace slides, tiled/canvas size changes
-and minimize/restore, including the fractional-scale run.
-
-Physical output moves and real fcitx5/IBus candidate windows remain manual
-qualification, as for the other app clients. Terminal text-input-v3 handles
-bounded UTF-8 commits and local preedit; it advertises no editable surrounding
-terminal output and rejects deletion requests. No compositor exception is used.
diff --git a/docs/themes.md b/docs/themes.md
deleted file mode 100644
index 04c9196..0000000
--- a/docs/themes.md
+++ /dev/null
@@ -1,299 +0,0 @@
-# Theme packs
-
-Choose a pack in **Settings → Appearance → Theme**. Changes to colours,
-fonts and geometry are stored as overrides of that pack. **Reset to theme**
-clears those overrides. Switching packs preserves personal settings, including
-wallpaper, cursor, dark mode and the separate taskbar theme; settings without
-an override follow the new pack. **Icon theme** chooses the installed icon
-theme behind a pack's own icons (the pack's `icon_theme`, when specified, takes precedence).
-
-**Install theme…** accepts a `.rediwm-theme` or `.zip` file. **Remove** is
-available for user-installed packs and switches an active pack to RediWM Dark.
-An existing pack requires **Replace installed theme**. **Save look…** saves
-the current colours, geometry, layout, wallpaper, logo and pack icon/glyph overrides as an installed pack and a
-shareable archive; use a lowercase filename such as `my-look.rediwm-theme`.
-Files installs `.rediwm-theme` files when opened and reports the result.
-
-A pack is a directory. Archives contain that directory's files at their root,
-or one enclosing directory. No code, bundled fonts or shaders are accepted.
-
-```text
-my-look/
- theme.toml
- preview.png optional, at most 512×320
- logo.svg optional; logo.png also works
- wallpapers/ PNG, JPEG or WebP
- glyphs/ monochrome SVGs, named like assets/icons/
- icons/ flat freedesktop names, SVG or PNG
- cursors/
- index.theme optional built Xcursor theme
- cursors/
-```
-
-```toml
-[meta]
-format = 1
-id = "my-look" # lowercase a–z, digits and hyphens; at most 64
-name = "My look"
-version = "1.0"
-author = "Example"
-license = "CC0-1.0"
-description = "A blue desktop."
-
-[theme]
-accent = "#88c0d0"
-start_button_icon = "logo.svg"
-
-[assets]
-wallpaper = "night.png" # inside wallpapers/
-color_scheme = "dark" # dark or light
-icon_theme = "Adwaita" # optional installed theme, behind icons/
-cursor_theme = "pack" # cursors/, or an installed cursor-theme name
-```
-
-`[taskbar_theme]` optionally supplies the taskbar's own colours and clock style
-(`clock_bold` and `clock_italic`). A pack can
-also float the bar with `[theme]` tokens `taskbar_edge_gap`, `taskbar_length`,
-`taskbar_radius` and `taskbar_outline_width`, and colour its outline with
-`taskbar_outline` (see `docs/wiki/Theme.md`). Unknown
-`[theme]` tokens are logged and skipped. Relative asset paths stay inside the
-pack; absolute paths, `..` and symlinks are refused. The only symlink exception
-is a cursor alias in `cursors/cursors/` whose target is a regular cursor file
-in that same directory.
-
-The user's configuration names the pack and just its personal edits:
-
-```toml
-[theme]
-base = "my-look"
-font_size = 14
-```
-
-Resolution is defaults → pack → config overrides → `REDIWM_THEME`. A missing
-or broken pack falls back to defaults. Configurations without `base`, and
-legacy single-file presets in the config directory's `themes/`, still work.
-Files and Images resolve the same layers; PDF freezes them before sandboxing.
-A pack is read on startup, config reload or apply; no pack directories are
-watched and no additional polling is introduced.
-
-Discovery uses the first occurrence of an ID: `$XDG_DATA_HOME/rediwm/themes`,
-legacy config presets, the binary's `../share/rediwm/themes`,
-`$XDG_DATA_DIRS/rediwm/themes`, then the embedded RediWM Dark, RediWM Light,
-Redi Blue, Redi-Mocha and Gold packs. Without `XDG_DATA_HOME`, use `~/.local/share`.
-
-Redi-Mocha uses the [Catppuccin Mocha palette](https://catppuccin.com/palette/#mocha)
-with mauve accents and the bundled `wallpaper-mocha.png` Auckland skyline.
-
-Gold uses warm charcoal decorations, ivory app content, champagne accents,
-the bundled gold wallpaper and colour icons. It puts the taskbar at the top
-and enables the bottom dock. Its 38-pixel bar has 12-pixel corners, a centered
-bold clock with italics off, Start on the left, the window list hidden, and
-capture, tray, battery, Wi-Fi, volume and Power on the right. Notifications
-use tinted backdrop glass.
-Choosing Gold also applies its folder, Home and Trash artwork to the desktop,
-Files and its sidebar; no separate icon-theme selection is needed. Pack icons
-take priority, with the usual icons filling any gaps.
-RediWM Dark, RediWM Light, Redi Blue and Redi-Mocha explicitly restore the
-standard 44-pixel taskbar at the bottom with the dock disabled.
-
-Gold's switches use shaded amber/grey tracks and ivory knobs. Set
-`toggle_shaded = true` for that recessed treatment; `toggle_on` and
-`toggle_thumb` optionally override the usual `accent` and `control_thumb`,
-while `toggle_track` controls the off colour.
-Its sliders use `slider_shaded = true` for a recessed rail, luminous fill and
-round metallic thumb. `slider_highlight` sets the bright reflections over the
-accent colour; `slider_track` sets the unfilled rail.
-
-## Layout defaults
-
-Packs may include this optional section:
-
-```toml
-[layout]
-taskbar_position = "top" # top or bottom
-# Section (left, center, right), order and visibility of each taskbar item, as
-# in [compositor]; prefix an entry with - to hide it (or ~ to show Wi-Fi/Ethernet only with the hardware). Every item but Power, capture and Ethernet is listed.
-taskbar_items = ["left:start", "left:clock", "center:windows", "right:tray", "right:battery", "right:wifi", "right:volume"]
-dock_enabled = true
-dock_position = "bottom" # top, bottom, left or right
-dock_height = 76 # thickness; 48–96 logical pixels
-dock_hover_zoom = 1.05 # 1.0–1.5; 1.0 disables hover enlargement
-```
-
-Only these appearance settings are accepted here. Resolution is compositor
-defaults → pack layout → explicit `[compositor]` settings. Switching themes
-preserves these personal overrides (including a taskbar item arrangement made
-in Appearance). **Reset to theme** clears them; without personal overrides, a
-pack without layout values uses the ordinary bottom taskbar, its usual item
-sections and a disabled dock.
-Hidden dock entries and application preferences are preserved. **Save look…**
-includes the current layout.
-
-## Separate surface palettes
-
-Optional `[theme]` colours `app_fg`, `app_sidebar_fg`, `app_sidebar_selected`,
-`app_sidebar_hover`, `app_surface_hover`, `app_menu_bg`,
-`app_field_bg` and `app_field_border` let client content differ from window
-decorations. The shared app loader resolves them for Files, Images, Editor
-and PDF, including their controls. Unset values keep existing theme behaviour.
-GTK colour export also uses the app and sidebar foregrounds.
-
-`app_sidebar_selected_marker` lights the selected Files sidebar row with a
-bright leading bar and an accent-coloured glow (the older name
-`app_sidebar_hover_marker` still loads); unset leaves the plain fill and accent
-bar. `app_sidebar_item_radius` rounds the hover and selection rows (default 5).
-Gold uses a 96% opaque selection, a faint hover, rounder rows and 50% opaque
-sidebars in Settings and Files.
-`app_sidebar_blur = true` lightly blurs the backdrop through their translucent areas;
-the content, text and icons keep their own opacity. Its sidebar
-and shell menu hovers stay brown so their ivory text remains readable; app
-content and toolbar hovers use champagne.
-
-Settings' Appearance labels and slider readouts use `app_text_size`, its
-uppercase headings use `app_heading_size`, and explanatory text uses
-`settings_description_size` (default 12). Card titles throughout Settings use
-`settings_title_size` (default 17). `settings_card_radius` also applies to the
-Bluetooth and Users cards. All these values reload with the theme.
-`status_connected` sets Bluetooth's connected indicator (default
-`rgba(51,219.3,114.75,1)`). `display_tile_border` sets the unselected screen
-outline in the display arrangement preview (default `rgba(255,255,255,0.16)`);
-selected screens keep the palette's accent outline.
-
-`dock_bg` and `dock_border` override the taskbar-derived dock colours;
-`dock_radius` is in logical pixels (zero follows the window frame radius);
-Appearance's **Dock corner radius** slider sets it.
-An explicit dock background uses its own alpha without the inherited dock's
-86% minimum. `notification_bg`, `notification_fg`, `notification_dim`,
-`notification_border`, `notification_icon_bg` and `notification_radius`
-control notification cards. `notification_blur = true` enables the existing
-backdrop renderer behind them. Defaults retain the previous appearance.
-
-Wi-Fi, battery and calendar popups accept `popup_bg`, `popup_border`, `popup_radius`
-and `popup_blur`. With blur enabled they use a rounded glass panel without a
-pointer. `popup_card_bg`, `popup_card_fg`, `popup_card_dim`,
-`popup_card_border` and `popup_card_radius` style the network rows and battery
-detail/profile cards. `popup_battery_ring` overrides the normal battery arc;
-critical charge still uses the danger colour. Gold uses 40%-opaque warm glass, ivory
-cards and an amber arc. Unset colours retain the stock appearance.
-
-## Terminal palette
-
-For Foot launched from RediWM's default-terminal action, dock, Start menu or
-desktop, a pack can supply `terminal_bg`, `terminal_fg`, `terminal_cursor`,
-`terminal_black`, `terminal_red`, `terminal_green`, `terminal_yellow`,
-`terminal_blue`, `terminal_magenta`, `terminal_cyan`, `terminal_white` and the
-corresponding `terminal_bright_*` colours. Entries are optional; unset entries
-keep Foot's configuration. Gold supplies a complete palette with champagne
-text and distinct ANSI colours.
-
-A short-lived `rediwm-theme terminal foot …` helper reads the active theme,
-detects Foot's older single-palette or newer dark/light configuration format,
-and replaces itself with Foot. It writes no terminal configuration and keeps
-explicit launcher overrides. Existing windows, terminals started directly
-from another shell, Foot server clients and other terminal emulators retain
-their own colours. The palette applies to newly launched Foot windows.
-
-The same helper passes Foot the background opacity from `[compositor]
-terminal_opacity` (0.0 to 1.0; Settings, Appearance, "Terminal opacity"). It is
-a setting of the user, not of the pack, so switching packs keeps it. Foot
-applies it to the background only; text stays opaque. Unset keeps the `alpha`
-of Foot's own configuration, and a value, even `1.0`, takes precedence over it.
-kitty, Alacritty, Ghostty and WezTerm get the same opacity as a launch flag
-(no helper, no palette); Konsole, GNOME Terminal and other VTE terminals read
-opacity only from their own profiles and are left alone.
-
-The helper is also available from a terminal:
-
-```sh
-rediwm-theme validate my-look/
-rediwm-theme pack my-look/ my-look.rediwm-theme
-rediwm-theme install my-look.rediwm-theme
-rediwm-theme install my-look.rediwm-theme --replace
-rediwm-theme remove my-look
-```
-
-Installs validate in a private staging directory and publish by atomic rename
-(or exchange on replacement). Archive parsing and asset validation run in
-separate children, restricted by Landlock when supported and seccomp, with
-memory and time bounds. There are at most 4,000 entries, 128 MiB unpacked,
-40 MiB per file, 512 KiB per icon and 64 KiB per glyph. Glyphs must render
-at 256 px in less than 10 ms; wallpaper sides are at most 16,384 px. SVG pack
-assets are rendered from data without a base URI. A failed install names the
-file and rule, cleans staging, and leaves an existing pack intact.
-
-IPC exposes `theme.list`, `theme.apply` (`{"id":"my-look"}`), and
-`theme.install` (`{"path":"/path/pack.rediwm-theme","replace":false}`).
-Install completes asynchronously while the event loop stays responsive.
-All three follow the IPC session-lock and sandbox allowance checks.
-
-## Asset inventory
-
-| Consumers | Artwork source |
-| --- | --- |
-| Compositor panels and titlebar controls | Theme tokens and shared shell SVG alpha masks |
-| Files, Images and PDF controls | The same shell masks, tinted with their effective theme |
-| Desktop Home/Trash | Shared shell masks and pack icon overrides |
-| Files directories and desktop folders | XDG special-folder name, then `folder`, through shared icon lookup |
-| Files documents | Association candidates and MIME icon names |
-| Taskbar, titlebars and Start menu applications | App icon names through shared icon lookup |
-| Wallpaper and lock-screen backdrop | Pack wallpaper unless a separate choice is pinned |
-| Start button | Pack logo or the embedded RediWM logo |
-
-Glyph filenames are the names in `assets/icons/`, including `wifi.svg`,
-`notification-bell.svg`, `speaker.svg`, `trash-outline.svg` and
-`view-grid.svg`. Only alpha is used. Flat colour icon overrides include
-`folder`, `user-home`, `user-desktop`, `folder-documents`, `folder-download`,
-`folder-music`, `folder-pictures`, `folder-videos`, `folder-templates`,
-`folder-publicshare`, `user-trash`, MIME names, and application icon names.
-The Settings app (its window, dock shortcut and Start menu entry) uses
-`rediwm-settings`; without a pack or installed icon of that name RediWM draws
-its built-in gear (`assets/icons/rediwm-settings.png`).
-XDG special directories come from `user-dirs.dirs`.
-
-The small pack in `tests/fixtures/theme-pack/` supplies a glyph, folder icon,
-wallpaper and logo. `tests/theme_packs.py` adds a real cursor and exercises
-installation, live switching, restoration, overrides and hostile archives.
-The greeter never discovers or reads user packs. The login screen follows
-the selected account's saved Appearance theme, using the same `lock_bg`,
-`lock_fg`, `lock_dim`, `lock_divider`, `lock_session_fg` and
-`lock_wallpaper_opacity` tokens as the lock screen, plus the shared font and
-control styling. All bundled themes define these colours.
-
-After a successful login, `rediwm-dm` provisions
-`/var/lib/rediwm-appearance/<uid>/` for that account. A normal desktop session
-saves its resolved theme there at startup and when Appearance changes. The
-wallpaper worker saves a decoded copy, preserving aspect ratio and limiting
-each dimension to 1920 pixels. These snapshots are deliberately public so
-the greeter can read them even when the home directory is private or encrypted;
-the original theme pack and wallpaper stay in the user's home.
-
-Selecting another account switches to its saved appearance. Missing or invalid
-snapshots fall back to `/etc/rediwm/greeter.toml` or the built-in default; a bad
-wallpaper does not discard valid colours. The first login after upgrading
-creates the snapshot. Nested/headless sessions never publish it. Sessions
-started without `rediwm-dm` can update an already provisioned directory, but
-cannot create one. The greeter only reads the snapshots and never runs their
-configuration as commands or reads paths from them.
-
-## Application launcher
-
-Super+Space opens the application launcher in the centre of the pointer's
-display. The taskbar Start button keeps the compact, edge-anchored menu.
-The existing `toggle_start_menu` shortcut action opens the centered launcher,
-so saved shortcut overrides continue to work.
-
-Type to filter applications, use Up/Down and Enter to launch, and Escape or
-Super+Space to dismiss. Tab switches between the list and the quick-launch
-cards; Left/Right select a card. Use the + button to pin an application and
-the checkmark to unpin it (up to five pins). Pins and recent launches are saved
-in `$XDG_STATE_HOME/rediwm/launcher`, falling back to
-`~/.local/state/rediwm/launcher`. With no history, Quick Launch offers the
-first applications in alphabetical order. On short displays, the cards are
-omitted to leave space for search results.
-
-The launcher shares the `start_menu_*` theme colours, corner radius, search
-field and selection styling with Start, as well as the shell's shared field
-and button tokens, application text sizes and icon theme.
-`start_menu_width` and `start_menu_max_height` override its automatic
-760×720 logical-pixel size; the panel is always capped to fit its display.
-Theme changes apply immediately while it is open.
diff --git a/scripts/install-session-root.sh b/scripts/install-session-root.sh
index 097f3a5..c93d6cb 100755
--- a/scripts/install-session-root.sh
+++ b/scripts/install-session-root.sh
@@ -12,7 +12,7 @@ umask 022
install -d /usr/local/bin
stage=$(mktemp -d /usr/local/bin/.rediwm-install.XXXXXX)
trap 'rm -rf -- "$stage"' EXIT HUP INT TERM
-for binary in rediwm rediwm-msg rediwm-theme rediwm-files rediwm-files-terminal rediwm-images rediwm-editor rediwm-pdf rediwm-share-picker rediwm-session rediwm-dm rediwm-accounts-helper; do
+for binary in rediwm rediwm-msg rediwm-theme rediwm-files rediwm-files-terminal rediwm-images rediwm-monitor rediwm-editor rediwm-pdf rediwm-share-picker rediwm-session rediwm-dm rediwm-accounts-helper; do
install -m755 "$release_dir/bin/$binary" "$stage/$binary"
done
install -Dm644 "$repo_dir/data/rediwm-theme.desktop" /usr/local/share/applications/rediwm-theme.desktop
@@ -21,6 +21,8 @@ install -Dm644 "$repo_dir/data/rediwm-files.desktop" /usr/local/share/applicatio
install -Dm644 "$release_dir/share/licenses/rediwm/libvterm-LICENSE" /usr/local/share/licenses/rediwm/libvterm-LICENSE
install -Dm644 "$release_dir/share/icons/hicolor/256x256/apps/redi-fm-icon.png" /usr/local/share/icons/hicolor/256x256/apps/redi-fm-icon.png
install -Dm644 "$repo_dir/data/rediwm-images.desktop" /usr/local/share/applications/rediwm-images.desktop
+install -Dm644 "$repo_dir/data/rediwm-monitor.desktop" /usr/local/share/applications/rediwm-monitor.desktop
+install -Dm644 "$release_dir/share/icons/hicolor/scalable/apps/rediwm-monitor.svg" /usr/local/share/icons/hicolor/scalable/apps/rediwm-monitor.svg
install -Dm644 "$repo_dir/data/rediwm-editor.desktop" /usr/local/share/applications/rediwm-editor.desktop
install -Dm644 "$repo_dir/data/rediwm-pdf.desktop" /usr/local/share/applications/rediwm-pdf.desktop
if command -v update-mime-database >/dev/null 2>&1; then update-mime-database /usr/local/share/mime; fi
@@ -71,7 +73,7 @@ for pack in "$release_dir"/share/rediwm/themes/*/; do
rm -rf "/usr/local/share/rediwm/themes/$name"
mv -T "/usr/local/share/rediwm/themes/.$name-new" "/usr/local/share/rediwm/themes/$name"
done
-for binary in rediwm rediwm-msg rediwm-theme rediwm-files rediwm-files-terminal rediwm-images rediwm-editor rediwm-pdf rediwm-share-picker rediwm-session rediwm-dm rediwm-accounts-helper; do
+for binary in rediwm rediwm-msg rediwm-theme rediwm-files rediwm-files-terminal rediwm-images rediwm-monitor rediwm-editor rediwm-pdf rediwm-share-picker rediwm-session rediwm-dm rediwm-accounts-helper; do
mv -fT "$stage/$binary" "/usr/local/bin/$binary"
done
# The compositor draws the desktop itself; the old client is retired.
diff --git a/scripts/install-session.sh b/scripts/install-session.sh
index e0e4e1d..90dc2d2 100644
--- a/scripts/install-session.sh
+++ b/scripts/install-session.sh
@@ -53,7 +53,7 @@ if [ "$prebuilt" = no ]; then
wlroots_flag=${REDIWM_WLROOTS_PREFIX:+-Dwlroots-prefix=$REDIWM_WLROOTS_PREFIX}
as_user zig build -Doptimize=ReleaseSafe -j"$ZIG_JOBS" --prefix "$release_dir" $wlroots_flag
fi
-for binary in rediwm rediwm-msg rediwm-theme rediwm-files rediwm-images rediwm-editor rediwm-pdf rediwm-share-picker rediwm-dm rediwm-accounts-helper; do
+for binary in rediwm rediwm-msg rediwm-theme rediwm-files rediwm-images rediwm-monitor rediwm-editor rediwm-pdf rediwm-share-picker rediwm-dm rediwm-accounts-helper; do
test -x "$release_dir/bin/$binary"
done
as_root sh "$repo_dir/scripts/install-session-root.sh" "$repo_dir" "$release_dir" "$dm_flag"
diff --git a/scripts/release-verify.sh b/scripts/release-verify.sh
index 3066c55..f247016 100644
--- a/scripts/release-verify.sh
+++ b/scripts/release-verify.sh
@@ -52,7 +52,7 @@ log "Checking the installed files"
for bin in /usr/local/bin/rediwm /usr/local/bin/rediwm-*; do
readelf -d "$bin" 2>/dev/null | grep -E 'RUNPATH|RPATH' | grep -q "/work/" && die "$bin carries a build path in its RUNPATH"
done
-for bin in rediwm rediwm-msg rediwm-theme rediwm-files rediwm-files-terminal rediwm-images rediwm-editor rediwm-pdf rediwm-share-picker rediwm-session rediwm-dm rediwm-accounts-helper; do
+for bin in rediwm rediwm-msg rediwm-theme rediwm-files rediwm-files-terminal rediwm-images rediwm-monitor rediwm-editor rediwm-pdf rediwm-share-picker rediwm-session rediwm-dm rediwm-accounts-helper; do
[ -x "/usr/local/bin/$bin" ] || die "/usr/local/bin/$bin is missing"
ldd "/usr/local/bin/$bin" 2>&1 | grep -q 'not found' && die "$bin has unresolved libraries"
done
diff --git a/src/Keyboard.zig b/src/Keyboard.zig
index b1a978f..331227f 100644
--- a/src/Keyboard.zig
+++ b/src/Keyboard.zig
@@ -895,6 +895,7 @@ fn shellKeyRepeats(keyboard: *Keyboard, event_keycode: u32, target: ShellTarget)
.polkit => if (server.polkit_dialog) |dialog| dialog.keyRepeats(sym, utf8) else false,
.lock => if (server.locker) |lock| lock.keyRepeats(sym, utf8) else false,
.control_center => |cc| blk: {
+ if (cc.search.initialized and @import("ui").input.current.focused == &cc.search.field) break :blk @import("input/repeat_keys.zig").editing(sym, utf8);
if (cc.page == .network) if (@import("ui").input.current.focused) |widget| {
if (widget.kind == .text_input or widget.kind == .secret_input) break :blk @import("input/repeat_keys.zig").editing(sym, utf8);
};
@@ -929,6 +930,10 @@ fn deliverShell(keyboard: *Keyboard, target: ShellTarget, event_keycode: u32) vo
.polkit => if (server.polkit_dialog) |dialog| if (syms.len > 0) dialog.key(syms[0], utf8, mods),
.lock => if (server.locker) |lock| if (syms.len > 0) lock.key(syms[0], utf8, mods),
.control_center => |cc| for (syms) |sym| {
+ if (mods.ctrl and !mods.alt and !mods.logo and (@intFromEnum(sym) == xkb.Keysym.f or @intFromEnum(sym) == xkb.Keysym.F)) {
+ cc.focusSearch();
+ break;
+ }
const key: ?@import("ui").input.Key = switch (@intFromEnum(sym)) {
xkb.Keysym.Escape => .escape,
xkb.Keysym.Return, xkb.Keysym.KP_Enter => .enter,
diff --git a/src/Shell.zig b/src/Shell.zig
index 7b8d628..ac901b8 100644
--- a/src/Shell.zig
+++ b/src/Shell.zig
@@ -27,7 +27,7 @@ new_xdg_popup: wl.Listener(*wlr.XdgPopup) = .init(newXdgPopup),
new_xdg_decoration: wl.Listener(*wlr.XdgToplevelDecorationV1) = .init(newXdgDecoration),
pub fn init(shell: *Shell, server: *Server) Server.CompositorError!void {
- const xdg_shell = wlr.XdgShell.create(server.wl_server, 2) catch return error.XdgShellCreateFailed;
+ const xdg_shell = wlr.XdgShell.create(server.wl_server, 6) catch return error.XdgShellCreateFailed;
const xdg_decoration_manager = wlr.XdgDecorationManagerV1.create(server.wl_server) catch return error.XdgDecorationCreateFailed;
// Both globals are destroyed with the display; Server.init's errdefer
// `wl_server.destroy()` covers a failure after this returns.
diff --git a/src/bluetooth.zig b/src/bluetooth.zig
index b74df0b..6d8e035 100644
--- a/src/bluetooth.zig
+++ b/src/bluetooth.zig
@@ -92,7 +92,7 @@ pub const Manager = struct {
m.cancelPair();
}
fn notify(m: *Manager) void {
- if (!m.closing) if (m.server.input.open_control_center) |cc| if (cc.page == .bluetooth) cc.refresh();
+ if (!m.closing) if (m.server.input.open_control_center) |cc| if (cc.showingPage(.bluetooth)) cc.refresh();
}
fn clearPrompt(m: *Manager) void {
if (m.reply) |*reply| if (m.conn) |conn| conn.releaseDeferred(reply);
@@ -188,7 +188,7 @@ pub const Manager = struct {
const iface = msg.headers.interface orelse "";
if (!eq(u8, iface, properties) and !eq(u8, iface, "org.freedesktop.DBus.ObjectManager")) return;
if (m.server.input.open_control_center) |cc| {
- if (cc.page == .bluetooth) m.fetch();
+ if (cc.showingPage(.bluetooth)) m.fetch();
} else if (m.busy) m.fetch();
}
fn request(m: *Manager, path: []const u8, iface: []const u8, member: []const u8, sig: []const u8, b: *const wire.Writer, device: Path, pair: bool, callback: dbus.Connection.Callback, timeout: u32) !void {
@@ -446,7 +446,7 @@ pub const Manager = struct {
m.notify();
return;
}
- const visible = if (m.server.input.open_control_center) |cc| cc.page == .bluetooth and cc.toplevel.in_world and !cc.toplevel.minimized else false;
+ const visible = if (m.server.input.open_control_center) |cc| cc.showingPage(.bluetooth) and cc.toplevel.in_world and !cc.toplevel.minimized else false;
var b = msg.body;
const path = try b.objectPath();
if (m.server.locker != null or !visible or m.pairing == null or !eq(u8, path, m.pairing.?.slice())) {
diff --git a/src/config/default.zig b/src/config/default.zig
index bd68f99..c76796d 100644
--- a/src/config/default.zig
+++ b/src/config/default.zig
@@ -381,9 +381,7 @@ pub const source =
\\"super+l" = "lock_screen"
\\"ctrl+alt+l" = "lock_screen"
\\"super+shift+e" = "quit"
- \\# poweroff/reboot/suspend go through logind, as the logged-in user;
- \\# system policy (polkit) decides whether to allow or challenge them.
- \\"ctrl+alt+delete" = "poweroff"
+ \\"ctrl+alt+delete" = "open_system_monitor"
\\# Take shortcuts back from a VM or remote desktop that captured the keyboard
\\"super+escape" = "restore_shortcuts"
\\
diff --git a/src/config/keybinds.zig b/src/config/keybinds.zig
index 2f3338d..f7f4df9 100644
--- a/src/config/keybinds.zig
+++ b/src/config/keybinds.zig
@@ -54,6 +54,7 @@ pub const Action = union(enum) {
tile_up,
tile_down,
toggle_start_menu,
+ open_system_monitor,
set_depth: u8,
zoom_in,
zoom_out,
@@ -308,6 +309,8 @@ test "poweroff, reboot and suspend parse and round-trip through describeAction"
try std.testing.expectEqual(Action.suspend_auto, try parseAction("suspend_auto", std.testing.allocator));
try std.testing.expectEqualStrings("suspend", describeAction(.@"suspend", &buf));
try std.testing.expectEqualStrings("poweroff_auto", describeAction(.poweroff_auto, &buf));
+ try std.testing.expectEqual(Action.open_system_monitor, try parseAction("open_system_monitor", std.testing.allocator));
+ try std.testing.expectEqualStrings("open_system_monitor", describeAction(.open_system_monitor, &buf));
}
test "parseAction splits on first space" {
diff --git a/src/config/loader_tests.zig b/src/config/loader_tests.zig
index 49f5fb5..101462b 100644
--- a/src/config/loader_tests.zig
+++ b/src/config/loader_tests.zig
@@ -84,12 +84,23 @@ test "empty config keeps built-in zoom steps and default keybinds" {
try std.testing.expectEqual(@as(u8, 4), cfg.compositor.zoom_step_count);
try std.testing.expectEqual(@as(u8, 100), cfg.compositor.zoom_percents[0]);
try std.testing.expect(cfg.autostart.len == 0);
+ const monitor = try keybinds.parseKeybind("Ctrl+Alt+Delete");
+ try std.testing.expectEqual(Action.open_system_monitor, cfg.lookupKeybind(monitor.modifiers, monitor.sym).?);
try std.testing.expect(cfg.keybinds.len > 0);
const spec = try keybinds.parseKeybind("super+t");
const action = cfg.lookupKeybind(spec.modifiers, spec.sym) orelse return error.TestExpectedEqual;
try std.testing.expectEqualStrings("default-terminal", action.spawn);
}
+test "System Monitor defaults preserve explicit canvas and workspace shortcut overrides" {
+ var cfg = try parse(std.testing.allocator, "[keybinds]\n\"Ctrl+Alt+Delete\" = \"poweroff\"\n[keybinds.workspace]\n\"Ctrl+Alt+Delete\" = \"noop\"\n", "mem");
+ defer cfg.deinit();
+ const binding = try keybinds.parseKeybind("Ctrl+Alt+Delete");
+ try std.testing.expectEqual(Action.poweroff, cfg.lookupKeybind(binding.modifiers, binding.sym).?);
+ cfg.compositor.desktop_mode = .workspaces;
+ try std.testing.expectEqual(Action.noop, cfg.lookupKeybind(binding.modifiers, binding.sym).?);
+}
+
test "the desktop follows its section, then a legacy rediwm-desktop autostart" {
var empty = try parse(std.testing.allocator, "", "empty");
defer empty.deinit();
@@ -903,6 +914,8 @@ test "workspace preset is independent, overrides include noop, and mode preserve
const two = try keybinds.parseKeybind("Super+2");
try std.testing.expectEqualStrings("custom-canvas", cfg.lookupKeybind(q.modifiers, q.sym).?.spawn);
cfg.compositor.desktop_mode = .workspaces;
+ const monitor = try keybinds.parseKeybind("Ctrl+Alt+Delete");
+ try std.testing.expectEqual(Action.open_system_monitor, cfg.lookupKeybind(monitor.modifiers, monitor.sym).?);
try std.testing.expectEqualStrings("default-terminal", cfg.lookupKeybind(q.modifiers, q.sym).?.spawn);
try std.testing.expectEqual(Action.noop, cfg.lookupKeybind(c.modifiers, c.sym).?);
try std.testing.expectEqual(@as(u8, 2), cfg.lookupKeybind(two.modifiers, two.sym).?.workspace);
diff --git a/src/config/workspace_defaults.zig b/src/config/workspace_defaults.zig
index 9206d63..36e9347 100644
--- a/src/config/workspace_defaults.zig
+++ b/src/config/workspace_defaults.zig
@@ -9,6 +9,7 @@ pub const source =
\\"Super+m" = "toggle_power_menu"
\\"Super+f" = "toggle_fullscreen"
\\"Super+l" = "lock_screen"
+ \\"Ctrl+Alt+Delete" = "open_system_monitor"
\\"Super+z" = "undo"
\\"Ctrl+Shift+s" = "screenshot_region"
\\"Ctrl+Tab" = "focus_next"
diff --git a/src/config_runtime/actions.zig b/src/config_runtime/actions.zig
index 84392b4..49e3703 100644
--- a/src/config_runtime/actions.zig
+++ b/src/config_runtime/actions.zig
@@ -39,6 +39,7 @@ pub fn executeAction(server: *Server, action: Action) void {
.tile_up => tileFocused(server, .up),
.tile_down => tileFocused(server, .down),
.toggle_start_menu => toggleStartMenu(server),
+ .open_system_monitor => openSystemMonitor(server),
.set_depth => |band| setFocusedDepth(server, band),
.zoom_in => zoomFocused(server, -1),
.zoom_out => zoomFocused(server, 1),
@@ -79,6 +80,27 @@ pub fn focusedToplevel(server: *Server) ?*Toplevel {
return @import("../ipc/handlers.zig").findFocusedToplevel(server) orelse server.world.toplevels.first();
}
+fn openSystemMonitor(server: *Server) void {
+ if (server.greeter_mode or server.locker != null or server.polkit_dialog != null) return;
+ var it = server.world.toplevels.iterator(.forward);
+ while (it.next()) |top| {
+ if (!top.in_world or !std.mem.eql(u8, top.appId(), "rediwm-monitor")) continue;
+ top.restore();
+ server.world.focus(top);
+ if (server.getDefaultOutput()) |output| server.world.navigateTo(top, output);
+ return;
+ }
+ if (server.launch_feedback.pendingDesktop("rediwm-monitor.desktop")) return;
+ // Sibling executable also works from a build tree whose bin isn't on PATH.
+ const dir = std.process.executableDirPathAlloc(server.io, gpa) catch return;
+ defer gpa.free(dir);
+ const executable = std.fs.path.join(gpa, &.{ dir, "rediwm-monitor" }) catch return;
+ defer gpa.free(executable);
+ if (spawnTracked(server, "rediwm-monitor", false, &.{executable})) |pid| {
+ server.launch_feedback.begin(.{ .pid = pid, .desktop_id = "rediwm-monitor.desktop" });
+ }
+}
+
fn tileFocused(server: *Server, dir: snap.Direction) void {
const toplevel = focusedToplevel(server) orelse return;
if (!toplevel.in_world or toplevel.minimized) return;
@@ -106,30 +128,30 @@ fn tileFocused(server: *Server, dir: snap.Direction) void {
}
pub fn spawnProcess(server: *Server, cmd: []const u8) void {
- spawnTracked(server, cmd, false, &.{ "/bin/sh", "-c", cmd });
+ _ = spawnTracked(server, cmd, false, &.{ "/bin/sh", "-c", cmd });
}
/// Runs `argv` directly, no shell, as `spawnProcess` would a command line.
pub fn spawnArgv(server: *Server, argv: []const []const u8) void {
- spawnTracked(server, argv[0], false, argv);
+ _ = spawnTracked(server, argv[0], false, argv);
}
pub fn spawnHelper(server: *Server, cmd: []const u8) void {
if (server.services) |manager| {
if (manager.helperRunning(cmd)) return;
}
- spawnTracked(server, cmd, true, &.{ "/bin/sh", "-c", cmd });
+ _ = spawnTracked(server, cmd, true, &.{ "/bin/sh", "-c", cmd });
}
-fn spawnTracked(server: *Server, cmd: []const u8, helper: bool, argv: []const []const u8) void {
+fn spawnTracked(server: *Server, cmd: []const u8, helper: bool, argv: []const []const u8) ?i32 {
var env_map = server.environ.createMap(gpa) catch |err| {
log.warn("autostart/spawn env: {}", .{err});
- return;
+ return null;
};
defer env_map.deinit();
server.applyChildEnv(&env_map) catch |err| {
log.warn("autostart/spawn env: {}", .{err});
- return;
+ return null;
};
const child = std.process.spawn(server.io, .{
.argv = argv,
@@ -137,7 +159,7 @@ fn spawnTracked(server: *Server, cmd: []const u8, helper: bool, argv: []const []
.pgid = if (helper) 0 else null,
}) catch |err| {
log.warn("spawn failed for '{s}': {}", .{ cmd, err });
- return;
+ return null;
};
if (child.id) |pid| {
app_scope.place(server, pid, app_scope.commandId(cmd));
@@ -148,6 +170,7 @@ fn spawnTracked(server: *Server, cmd: []const u8, helper: bool, argv: []const []
} else s.trackChild(pid) catch {};
}
}
+ return child.id;
}
pub fn spawnAutostartCommand(server: *Server, cmd: []const u8) void {
@@ -639,5 +662,5 @@ fn launchPreferred(server: *Server, cmd: []const u8) void {
if (args.len == 0) return;
const themed = @import("config").terminal_theme.wrap(arena.allocator(), server.io, args, server.config.theme, server.config.compositor.terminal_opacity) catch return;
if (themed.ptr == args.ptr) return spawnProcess(server, command);
- spawnTracked(server, command, false, themed);
+ _ = spawnTracked(server, command, false, themed);
}
diff --git a/src/control_center/AGENTS.md b/src/control_center/AGENTS.md
index 3367fd0..5d7300e 100644
--- a/src/control_center/AGENTS.md
+++ b/src/control_center/AGENTS.md
@@ -52,3 +52,10 @@ Settings is an ordinary window with a compositor-drawn body (`Backend.shell`).
Discovered backend URIs must match the current helper catalog exactly;
arbitrary typed vendor/file backends are not allowed. PPD settings use
`PrinterAddOption` after clearing stale IPP defaults, followed by readback.
+
+* Global search uses `search_index.zig` destinations (widget names or `@` plus
+ visible label text), without building hidden sections. Add an index entry
+ with new settings. A selected category can be covered by search results:
+ background callbacks must use `showingPage`, rather than `page`, to decide
+ whether to refresh or fetch for it. The search field owns its text across
+ rebuilds; result widgets/strings belong to a separate arena.
diff --git a/src/control_center/panel.zig b/src/control_center/panel.zig
index d627e5e..1d528a1 100644
--- a/src/control_center/panel.zig
+++ b/src/control_center/panel.zig
@@ -40,6 +40,7 @@ const network_section = @import("sections/network.zig");
const log = std.log.scoped(.control_center);
const welcome_section = @import("welcome.zig");
+const settings_search = @import("search.zig");
/// Default content size; a saved size (window_sizes) or a rule wins.
const default_width = 960;
@@ -48,8 +49,8 @@ const default_height = 640;
// .glass-strong uses shared CSS palette and --r-lg.
const theme = @import("ui").theme;
-pub const Page = enum { general, input, displays, audio, network, appearance, shortcuts, desktop, bluetooth, region, users, printers, services };
-const page_labels = [_][]const u8{ "General", "Input", "Displays", "Audio", "Network", "Appearance", "Keyboard Shortcuts", "Desktop", "Bluetooth", "Region & Language", "Users", "Printers", "Services" };
+pub const Page = @import("search_index.zig").Page;
+pub const page_labels = [_][]const u8{ "General", "Input", "Displays", "Audio", "Network", "Appearance", "Keyboard Shortcuts", "Desktop", "Bluetooth", "Region & Language", "Users", "Printers", "Services" };
const page_names = [_][]const u8{ "general", "input", "displays", "audio", "network", "appearance", "shortcuts", "desktop", "bluetooth", "region", "users", "printers", "services" };
const page_descriptions = [_][]const u8{
"Everyday controls, all in one place.", "Make your mouse and keyboard feel right.",
@@ -179,6 +180,8 @@ pub const ControlCenter = struct {
root: Widget = undefined,
root_children: [2]Widget = undefined,
body_children: [2]Widget = undefined,
+ search: settings_search.State = .{},
+ sidebar_children: [2]Widget = undefined,
nav_rows: [page_names.len]Widget = undefined,
nav_children: [page_names.len][2]Widget = undefined,
// Sized for the worst case across all pages: 2 (heading + description)
@@ -313,6 +316,7 @@ pub const ControlCenter = struct {
cc.shortcuts.cancel();
if (cc.systemd_client) |client| client.detachSettings();
cc.welcome.deinit();
+ cc.search.deinit();
cc.services.deinit();
cc.printers.deinit();
cc.network.deinit();
@@ -435,6 +439,19 @@ pub const ControlCenter = struct {
cc.refresh_pending = false;
return;
}
+ cc.search.capture();
+ if (cc.search.active != cc.search.built_active) {
+ if (cc.search.active) {
+ if (cc.body_children[1].kind == .scroll_container) cc.search.saved_scroll = cc.body_children[1].kind.scroll_container;
+ cc.shortcuts.cancel();
+ if (cc.page == .services) if (cc.systemd_client) |client| client.hide();
+ if (cc.page == .printers) cc.printers.hide();
+ if (cc.page == .bluetooth) if (cc.server.bluetooth) |manager| manager.closed();
+ } else {
+ cc.search.restore_scroll = true;
+ if (cc.page == .bluetooth) if (cc.server.bluetooth) |manager| manager.opened();
+ }
+ }
cc.services.capture();
if (cc.page == .bluetooth and cc.built_page == .bluetooth) cc.bluetooth.capture();
if (cc.page == .network and cc.built_page == .network) cc.network.captureFocus();
@@ -446,32 +463,33 @@ pub const ControlCenter = struct {
const selected_row: f32 = @floatFromInt(@intFromEnum(cc.page));
if (cc.nav_selection.to != selected_row) cc.nav_selection.cancel(selected_row);
const t = palette();
- if (cc.page == .displays) {
- const selected = cc.selectedDisplayOutput() orelse cc.wlr_output;
- display_section.build(&cc.display, cc, selected);
- }
- if (cc.page == .general or cc.page == .audio) {
- sound_section.build(&cc.sound, cc.server.audio);
- restyle(&cc.sound.root);
- }
- if (cc.page == .appearance) {
- appearance_section.build(&cc.appearance, cc);
- restyle(&cc.appearance.root);
- }
- if (cc.page == .input) {
- input_section.build(&cc.input, &cc.server.input);
- restyle(&cc.input.root);
- }
- if (cc.page == .displays) restyle(&cc.display.root);
- if (cc.page == .users) {
- users_section.build(&cc.users, cc);
- restyle(&cc.users.root);
+ if (!cc.search.active) {
+ if (cc.page == .displays) {
+ const selected = cc.selectedDisplayOutput() orelse cc.wlr_output;
+ display_section.build(&cc.display, cc, selected);
+ }
+ if (cc.page == .general or cc.page == .audio) {
+ sound_section.build(&cc.sound, cc.server.audio);
+ restyle(&cc.sound.root);
+ }
+ if (cc.page == .appearance) {
+ appearance_section.build(&cc.appearance, cc);
+ restyle(&cc.appearance.root);
+ }
+ if (cc.page == .input) {
+ input_section.build(&cc.input, &cc.server.input);
+ restyle(&cc.input.root);
+ }
+ if (cc.page == .displays) restyle(&cc.display.root);
+ if (cc.page == .users) {
+ users_section.build(&cc.users, cc);
+ restyle(&cc.users.root);
+ }
}
-
const narrow = cc.panel_box.width < 660;
const nav_count = page_names.len - @as(usize, @intFromBool(!has_services));
const nav_gap: f32 = if (cc.panel_box.height < 550) 2 else 5;
- const nav_height = @min(52, @max(24, (@as(f32, @floatFromInt(cc.panel_box.height)) - 48 - nav_gap * @as(f32, @floatFromInt(nav_count - 1))) / @as(f32, @floatFromInt(nav_count))));
+ const nav_height = @min(52, @max(24, (@as(f32, @floatFromInt(cc.panel_box.height)) - 92 - (if (narrow and cc.search.expanded) @as(f32, 46) else 0) - nav_gap * @as(f32, @floatFromInt(nav_count - 1))) / @as(f32, @floatFromInt(nav_count))));
const nav_fg = theme.global.sidebarForeground();
for (cc.nav_rows[0..nav_count], 0..) |*row, i| {
const selected = i == @intFromEnum(cc.page);
@@ -492,104 +510,119 @@ pub const ControlCenter = struct {
.children = cc.nav_children[i][0..if (narrow) @as(usize, 1) else 2],
};
}
- cc.content_count = 0;
- var heading = label(page_labels[@intFromEnum(cc.page)], 24, false);
- heading.kind.text.weight = 600;
- if (cc.page != .bluetooth) {
- cc.append(heading);
- cc.append(label(page_descriptions[@intFromEnum(cc.page)], 13, true));
- }
- switch (cc.page) {
- .desktop => {
- desktop_section.build(&cc.desktop, cc);
- cc.append(cc.desktop.root);
- },
- .region => {
- region_section.build(&cc.region, cc);
- cc.append(cc.region.root);
- },
- .users => cc.append(cc.users.root),
- .services => {
- services_section.build(&cc.services, cc);
- cc.append(cc.services.root);
- },
- .printers => {
- printers_section.build(&cc.printers, cc);
- cc.append(cc.printers.root);
- },
- .shortcuts => {
- shortcut_section.build(&cc.shortcuts, cc);
- for (cc.shortcuts.groups[0..cc.shortcuts.group_count]) |widget| cc.append(widget);
- },
- .general => cc.buildGeneral(),
- .bluetooth => {
- bluetooth_section.build(&cc.bluetooth, cc);
- cc.append(cc.bluetooth.root);
- },
- .network => {
- network_section.build(&cc.network, cc);
- cc.append(cc.network.root);
- },
- .input => for (cc.input.row_storage[0..cc.input.row_count]) |*row| {
- var framed = card(row.children);
- framed.name = "input";
- framed.direction = row.direction;
- framed.justify = row.justify;
- framed.@"align" = if (row.direction == .column) .stretch else row.@"align";
- cc.append(framed);
- },
- .displays => {
- if (cc.display.has_arrangement) {
- var arrangement_card = card(&cc.display.arrangement_children);
- arrangement_card.name = "displays";
- cc.append(arrangement_card);
- }
- var display_card = card(&cc.display.row_storage);
- display_card.name = "displays";
- cc.append(display_card);
- cc.append(cc.display.top_children[2]);
- cc.append(cc.display.xwayland_hint);
- var nl_card = card(&cc.display.nl_group_children);
- nl_card.name = "displays";
- cc.append(nl_card);
- if (cc.display.has_lid) {
- var lid_card = card(&cc.display.lid_group_children);
- lid_card.name = "displays";
- cc.append(lid_card);
- }
- },
- .audio => {
- var audio_card = card(cc.sound.top_children[1].children);
- audio_card.name = "sound";
- cc.append(audio_card);
- cc.buildDevices();
- if (cc.device_count > 0) {
- cc.device_title = .{ sectionTitle("Audio output"), .{ .kind = .container, .direction = .column, .gap = 4, .children = cc.device_rows[0..cc.device_count] } };
- var dev_card = card(&cc.device_title);
- dev_card.name = "sound";
- cc.append(dev_card);
- }
- },
- .appearance => for (&cc.appearance.group_cards) |*row| {
- var framed = card(row.children);
- framed.name = "appearance";
- framed.direction = row.direction;
- framed.justify = row.justify;
- framed.@"align" = if (row.direction == .column) .stretch else row.@"align";
- cc.append(framed);
- },
+ if (!cc.search.active) {
+ cc.content_count = 0;
+ var heading = label(page_labels[@intFromEnum(cc.page)], 24, false);
+ heading.kind.text.weight = 600;
+ if (cc.page != .bluetooth) {
+ cc.append(heading);
+ cc.append(label(page_descriptions[@intFromEnum(cc.page)], 13, true));
+ }
+ if (cc.search.unavailable) cc.append(label("This setting is unavailable on this device or in the current mode.", t.settings_description_size, true));
+ switch (cc.page) {
+ .desktop => {
+ desktop_section.build(&cc.desktop, cc);
+ cc.append(cc.desktop.root);
+ },
+ .region => {
+ region_section.build(&cc.region, cc);
+ cc.append(cc.region.root);
+ },
+ .users => cc.append(cc.users.root),
+ .services => {
+ services_section.build(&cc.services, cc);
+ cc.append(cc.services.root);
+ },
+ .printers => {
+ printers_section.build(&cc.printers, cc);
+ cc.append(cc.printers.root);
+ },
+ .shortcuts => {
+ shortcut_section.build(&cc.shortcuts, cc);
+ for (cc.shortcuts.groups[0..cc.shortcuts.group_count]) |widget| cc.append(widget);
+ },
+ .general => cc.buildGeneral(),
+ .bluetooth => {
+ bluetooth_section.build(&cc.bluetooth, cc);
+ cc.append(cc.bluetooth.root);
+ },
+ .network => {
+ network_section.build(&cc.network, cc);
+ cc.append(cc.network.root);
+ },
+ .input => for (cc.input.row_storage[0..cc.input.row_count]) |*row| {
+ var framed = card(row.children);
+ framed.name = "input";
+ framed.direction = row.direction;
+ framed.justify = row.justify;
+ framed.@"align" = if (row.direction == .column) .stretch else row.@"align";
+ cc.append(framed);
+ },
+ .displays => {
+ if (cc.display.has_arrangement) {
+ var arrangement_card = card(&cc.display.arrangement_children);
+ arrangement_card.name = "displays";
+ cc.append(arrangement_card);
+ }
+ var display_card = card(&cc.display.row_storage);
+ display_card.name = "displays";
+ cc.append(display_card);
+ cc.append(cc.display.top_children[2]);
+ cc.append(cc.display.xwayland_hint);
+ var nl_card = card(&cc.display.nl_group_children);
+ nl_card.name = "displays";
+ cc.append(nl_card);
+ if (cc.display.has_lid) {
+ var lid_card = card(&cc.display.lid_group_children);
+ lid_card.name = "displays";
+ cc.append(lid_card);
+ }
+ },
+ .audio => {
+ var audio_card = card(cc.sound.top_children[1].children);
+ audio_card.name = "sound";
+ cc.append(audio_card);
+ cc.buildDevices();
+ if (cc.device_count > 0) {
+ cc.device_title = .{ sectionTitle("Audio output"), .{ .kind = .container, .direction = .column, .gap = 4, .children = cc.device_rows[0..cc.device_count] } };
+ var dev_card = card(&cc.device_title);
+ dev_card.name = "sound";
+ cc.append(dev_card);
+ }
+ },
+ .appearance => for (&cc.appearance.group_cards) |*row| {
+ var framed = card(row.children);
+ framed.name = "appearance";
+ framed.direction = row.direction;
+ framed.justify = row.justify;
+ framed.@"align" = if (row.direction == .column) .stretch else row.@"align";
+ cc.append(framed);
+ },
+ }
+ } else {
+ cc.content_count = 0;
+ cc.append(cc.search.build(cc));
}
+ cc.search.buildToolbar(cc);
+ cc.sidebar_children = .{
+ if (narrow)
+ .{ .name = "settings_search_open", .kind = .{ .button = .{ .icon = .search, .label = "Search settings", .owner = cc, .on_click = settings_search.focusClicked } }, .height = .{ .fixed = 36 }, .width = .{ .percent = 1 } }
+ else
+ .{ .kind = .container, .height = .{ .fixed = 36 }, .width = .{ .percent = 1 }, .children = (&cc.search.toolbar)[0..1] },
+ .{ .name = "nav", .kind = if (cc.panel_box.height < (if (narrow and cc.search.expanded) @as(i32, 486) else 440)) .{ .scroll_container = .{} } else .container, .direction = .column, .width = .{ .percent = 1 }, .height = .{ .flex = 1 }, .gap = nav_gap, .underlay = .{ .owner = cc, .paint = paintNavHighlights }, .children = cc.nav_rows[0..nav_count] },
+ };
cc.body_children = .{
- .{ .name = "nav", .kind = .{ .rect = .{ .color = t.app_sidebar, .replace = t.app_sidebar[3] < 1, .radius = t.settings_sidebar_radius, .border_width = 1, .border_color = t.app_item_border } }, .direction = .column, .width = .{ .fixed = if (narrow) 70 else 238 }, .height = .{ .percent = 1 }, .padding = layout.Edges.all(8), .gap = nav_gap, .underlay = .{ .owner = cc, .paint = paintNavHighlights }, .children = cc.nav_rows[0..nav_count] },
+ .{ .name = "settings_sidebar", .kind = .{ .rect = .{ .color = t.app_sidebar, .replace = t.app_sidebar[3] < 1, .radius = t.settings_sidebar_radius, .border_width = 1, .border_color = t.app_item_border } }, .direction = .column, .width = .{ .fixed = if (narrow) 70 else 238 }, .height = .{ .percent = 1 }, .padding = layout.Edges.all(8), .gap = 8, .children = &cc.sidebar_children },
.{ .kind = .{ .scroll_container = .{} }, .direction = .column, .@"align" = .stretch, .width = .{ .flex = 1 }, .height = .{ .percent = 1 }, .padding = layout.Edges.all(12), .gap = 14, .children = cc.content_children[0..cc.content_count] },
};
- if (cc.page == .services) {
+ if (cc.page == .services and !cc.search.active) {
cc.body_children[1].kind = .container;
} else {
// Keep the scrollbar's full hover/drag gutter outside the cards.
cc.body_children[1].padding.right += ui.widgets.scrollbar.gutter(theme.global.scrollbar_width);
}
- cc.root_children[0] = .{ .kind = .container, .direction = .row, .padding = .{ .left = 16, .top = 16, .bottom = 16, .right = if (cc.page == .services) 16 else 6 }, .gap = 14, .width = .{ .percent = 1 }, .height = .{ .flex = 1 }, .children = &cc.body_children };
+ cc.root_children[0] = .{ .kind = .container, .direction = .column, .padding = .{ .left = 16, .right = 16, .top = 10 }, .width = .{ .percent = 1 }, .height = .{ .fixed = 46 }, .children = (&cc.search.toolbar)[0..1] };
+ cc.root_children[1] = .{ .kind = .container, .direction = .row, .padding = .{ .left = 16, .top = 16, .bottom = 16, .right = if (cc.page == .services) 16 else 6 }, .gap = 14, .width = .{ .percent = 1 }, .height = .{ .flex = 1 }, .children = &cc.body_children };
// The content stays opaque; the sidebar replaces its background with
// app_sidebar so translucent themes expose the scene beneath it.
cc.root = .{
@@ -598,15 +631,21 @@ pub const ControlCenter = struct {
.gap = 0,
.width = .{ .fixed = @floatFromInt(cc.panel_box.width) },
.height = .{ .fixed = @floatFromInt(cc.panel_box.height) },
- .children = cc.root_children[0..1],
+ .children = cc.root_children[if (narrow and cc.search.expanded) @as(usize, 0) else 1..2],
};
cc.root.linkParents();
- if (cc.page == .services and cc.services.search_focus) {
+ if (!cc.search.active and cc.page == .services and cc.services.search_focus) {
if (cc.services.search) |field| ui.input.current.focus(&cc.root, field);
}
- if (cc.page == .users) {
+ if (!cc.search.active and cc.page == .users) {
if (users_section.initialFormFocus(&cc.users)) |field| ui.input.current.focus(&cc.root, field);
}
+ if (cc.search.focused or cc.search.request_focus) {
+ if (cc.search.initialized) ui.input.current.focus(&cc.root, &cc.search.field);
+ cc.search.request_focus = false;
+ }
+ cc.search.reset_scroll = false;
+ cc.search.built_active = cc.search.active;
cc.built_page = cc.page;
cc.refresh_pending = false;
}
@@ -700,6 +739,11 @@ pub const ControlCenter = struct {
}
pub fn selectPage(cc: *ControlCenter, page: Page) void {
+ if (cc.search.active) {
+ settings_search.clear(cc);
+ cc.search.built_active = false;
+ cc.search.restore_scroll = false;
+ }
cc.shortcuts.cancel();
// The service list is only kept live while its page is on screen.
if (cc.page == .services and page != .services) if (cc.systemd_client) |client| client.hide();
@@ -748,7 +792,17 @@ pub const ControlCenter = struct {
}
/// Route select keys before panel-level Escape. Tab cycles display fields.
+ /// Global search replaces the page body without selecting another category.
+ pub fn showingPage(cc: *const ControlCenter, page: Page) bool {
+ return !cc.is_welcome and !cc.search.active and cc.page == page;
+ }
+
+ pub fn focusSearch(cc: *ControlCenter) void {
+ settings_search.focus(cc);
+ }
+
pub fn selectKey(cc: *ControlCenter, key: ui.input.Key, shift: bool) bool {
+ if (settings_search.key(cc, key, shift)) return true;
if (cc.page != .displays and cc.page != .appearance and cc.page != .desktop and cc.page != .general and cc.page != .users and cc.page != .services and cc.page != .printers and cc.page != .network and cc.page != .bluetooth and cc.page != .region) return false;
const dispatcher = &ui.input.current;
if (cc.page == .appearance) {
@@ -873,6 +927,10 @@ pub const ControlCenter = struct {
}
fn applyPending(cc: *ControlCenter) void {
+ if (cc.search.pending_result != null) {
+ settings_search.apply(cc);
+ return;
+ }
if (cc.page == .services) services_section.apply(&cc.services, cc);
cc.shortcuts.apply(cc);
if (cc.page == .displays) {
@@ -963,7 +1021,7 @@ pub const ControlCenter = struct {
fn rebuildTree(cc: *ControlCenter) void {
const hovered_nav = cc.nav_hover.target;
const same_page = cc.built_page == cc.page;
- const bluetooth_scroll: ?layout.ScrollState = if (same_page and cc.page == .bluetooth) cc.body_children[1].kind.scroll_container else null;
+ const bluetooth_scroll: ?layout.ScrollState = if (same_page and cc.page == .bluetooth and !cc.search.active and !cc.search.built_active) cc.body_children[1].kind.scroll_container else null;
var saved: ui.widgets.slider.Saved = .{};
var knobs: ui.widgets.toggle.Saved = .{};
if (same_page) {
@@ -973,7 +1031,7 @@ pub const ControlCenter = struct {
cc.buildTree();
if (hovered_nav) |cell| {
const index: usize = @intCast(cell.row);
- if (index < cc.body_children[0].children.len) {
+ if (index < cc.sidebar_children[1].children.len) {
cc.nav_rows[index].kind.row.state = .hover;
ui.input.adoptHover(&cc.root, &cc.nav_rows[index]);
} else cc.nav_hover.setTarget(anim.nowMs(), null);
@@ -997,12 +1055,19 @@ pub const ControlCenter = struct {
cc.background.invalidate();
const width: f32 = @floatFromInt(cc.panel_box.width);
const height: f32 = @floatFromInt(cc.panel_box.height);
+ if (cc.search.restore_scroll and cc.body_children[1].kind == .scroll_container) {
+ cc.body_children[1].kind.scroll_container = cc.search.saved_scroll;
+ cc.search.restore_scroll = false;
+ }
ui.measure.measure(&cc.root, width, height);
ui.arrange.arrange(&cc.root, 0, 0, width, height);
- if (cc.page == .appearance) appearance_section.restoreItemFocus(&cc.appearance);
- if (cc.page == .network) network_section.restoreFocus(&cc.network, cc);
- if (cc.page == .bluetooth) bluetooth_section.restoreFocus(&cc.bluetooth, cc);
- if (cc.page == .printers) cc.printers.restoreFocus(cc);
+ if (!cc.search.active and ui.input.current.focused != &cc.search.field) {
+ if (cc.page == .appearance) appearance_section.restoreItemFocus(&cc.appearance);
+ if (cc.page == .network) network_section.restoreFocus(&cc.network, cc);
+ if (cc.page == .bluetooth) bluetooth_section.restoreFocus(&cc.bluetooth, cc);
+ if (cc.page == .printers) cc.printers.restoreFocus(cc);
+ }
+ settings_search.reveal(cc);
cc.dirty = true;
}
@@ -1011,7 +1076,10 @@ pub const ControlCenter = struct {
fn resizeNeedsTree(cc: *const ControlCenter) bool {
if (cc.is_welcome) return (cc.root.computed_width < 680) != (cc.panel_box.width < 680) or (cc.root.computed_height < 740) != welcome_section.compact(cc);
const old = cc.root.computed_width;
+ if ((old < 660) != (cc.panel_box.width < 660)) return true;
const width: f32 = @floatFromInt(cc.panel_box.width);
+ const nav_height_limit: f32 = if (width < 660 and cc.search.expanded) 486 else 440;
+ if ((cc.root.computed_height < nav_height_limit) != (@as(f32, @floatFromInt(cc.panel_box.height)) < nav_height_limit)) return true;
const thresholds: []const f32 = switch (cc.page) {
.shortcuts => &.{660},
.desktop => &.{760},
@@ -1033,11 +1101,11 @@ pub const ControlCenter = struct {
return;
}
const narrow = cc.panel_box.width < 660;
- const nav_count = cc.body_children[0].children.len;
+ const nav_count = cc.sidebar_children[1].children.len;
const gap: f32 = if (cc.panel_box.height < 550) 2 else 5;
- const height = @min(52, @max(24, (@as(f32, @floatFromInt(cc.panel_box.height)) - 48 - gap * @as(f32, @floatFromInt(nav_count - 1))) / @as(f32, @floatFromInt(nav_count))));
+ const height = @min(52, @max(24, (@as(f32, @floatFromInt(cc.panel_box.height)) - 92 - (if (narrow and cc.search.expanded) @as(f32, 46) else 0) - gap * @as(f32, @floatFromInt(nav_count - 1))) / @as(f32, @floatFromInt(nav_count))));
cc.body_children[0].width = .{ .fixed = if (narrow) 70 else 238 };
- cc.body_children[0].gap = gap;
+ cc.sidebar_children[1].gap = gap;
for (cc.nav_rows[0..nav_count], 0..) |*row, i| {
row.height = .{ .fixed = height };
row.children = cc.nav_children[i][0..if (narrow) @as(usize, 1) else 2];
@@ -1059,7 +1127,7 @@ pub const ControlCenter = struct {
const rebuild = cc.refresh_pending and !cc.pointer_down and ui.input.openSelect(&cc.root) == null;
if ((cc.layout_pending or rebuild) and cc.panel_box.width > 0 and cc.panel_box.height > 0) {
cc.layout_pending = false;
- const body = if (cc.body_children[1].kind == .scroll_container) cc.body_children[1].kind.scroll_container else null;
+ const body = if (!cc.search.reset_scroll and cc.search.active == cc.search.built_active and cc.body_children[1].kind == .scroll_container) cc.body_children[1].kind.scroll_container else null;
if (rebuild or cc.resizeNeedsTree()) cc.rebuildTree();
cc.resizeLayout();
// Keep a wheel glide going across the rebuild.
@@ -1105,7 +1173,8 @@ pub const ControlCenter = struct {
}
fn stepNavHighlights(cc: *ControlCenter, now_ms: i64) bool {
- const list = &cc.body_children[0];
+ if (cc.is_welcome) return false;
+ const list = &cc.sidebar_children[1];
if (list.children.len == 0) return false;
const pitch = @max(1, list.children[0].computed_height + list.gap);
const q = anim.rasterPixelQuantum(cc.toplevel.render_scale) / pitch;
@@ -1260,6 +1329,7 @@ pub fn overDraggable(cc: *ControlCenter, sx: f64, sy: f64) bool {
}
pub fn pointerButtonDown(cc: *ControlCenter, sx: f64, sy: f64) void {
+ if (!cc.is_welcome and sx >= cc.body_children[1].computed_x) settings_search.dismiss(cc);
cc.pointer_down = true;
if (cc.page == .appearance and appearance_section.beginItemDrag(&cc.appearance, @floatCast(sx), @floatCast(sy))) return;
ui.input.pointerButtonDown(&cc.root, @floatCast(sx), @floatCast(sy));
@@ -1296,6 +1366,13 @@ pub fn bodyColor() [4]f32 {
fn pageClicked(owner: ?*anyopaque, id: usize) void {
const cc: *ControlCenter = @ptrCast(@alignCast(owner orelse return));
+ if (cc.search.query().len > 0) settings_search.clear(cc);
+ cc.search.built_active = false;
+ cc.search.restore_scroll = false;
+ cc.search.unavailable = false;
+ cc.search.destination = null;
+ cc.search.focused = false;
+ cc.search.request_focus = false;
cc.pending_page = @enumFromInt(id);
}
diff --git a/src/control_center/sections/shortcuts.zig b/src/control_center/sections/shortcuts.zig
index 1799464..d40ac88 100644
--- a/src/control_center/sections/shortcuts.zig
+++ b/src/control_center/sections/shortcuts.zig
@@ -251,6 +251,7 @@ fn descriptionFor(action: keys.Action, buf: []u8) []const u8 {
.workspace_next => "Cycle to the next existing workspace.",
.workspace_prev => "Cycle to the previous existing workspace.",
.toggle_power_menu => "Open the session and power menu.",
+ .open_system_monitor => "Open System Monitor, or restore and focus its window.",
.noop => "Disabled shortcut.",
.toggle_fullscreen => "Enter or leave fullscreen.",
.toggle_maximize => "Maximize or restore the focused window.",
diff --git a/src/editor/main.zig b/src/editor/main.zig
index 2f1a5ef..2e66c10 100644
--- a/src/editor/main.zig
+++ b/src/editor/main.zig
@@ -301,6 +301,7 @@ pub const Client = struct {
.close => {
self.app.requestClose();
},
+ .configure_bounds, .wm_capabilities => {},
}
}
diff --git a/src/files/main.zig b/src/files/main.zig
index 10071d8..128c843 100644
--- a/src/files/main.zig
+++ b/src/files/main.zig
@@ -391,6 +391,7 @@ pub const Client = struct {
.close => {
self.app.terminalRequestClose();
},
+ .configure_bounds, .wm_capabilities => {},
}
}
diff --git a/src/images/main.zig b/src/images/main.zig
index 9edd222..d27376b 100644
--- a/src/images/main.zig
+++ b/src/images/main.zig
@@ -352,6 +352,7 @@ pub const Client = struct {
.close => {
self.app.requestClose();
},
+ .configure_bounds, .wm_capabilities => {},
}
}
diff --git a/src/ipc/processes.zig b/src/ipc/processes.zig
index 5cae263..eb1b619 100644
--- a/src/ipc/processes.zig
+++ b/src/ipc/processes.zig
@@ -80,32 +80,11 @@ pub const Job = struct {
const Sample = struct { cpu: u64, start: u64, rss: u64 };
fn readSample(pid: i32) ?Sample {
- var path: [64]u8 = undefined;
- const name = std.fmt.bufPrintZ(&path, "/proc/{d}/stat", .{pid}) catch return null;
- const fd = c.open(name, c.O_RDONLY | c.O_CLOEXEC);
- if (fd < 0) return null;
- defer _ = c.close(fd);
var buf: [4096]u8 = undefined;
- const n = c.read(fd, &buf, buf.len);
- if (n <= 0) return null;
- const bytes = buf[0..@intCast(n)];
- const end = std.mem.lastIndexOfScalar(u8, bytes, ')') orelse return null;
- var fields = std.mem.tokenizeScalar(u8, bytes[end + 1 ..], ' ');
- var utime: u64 = 0;
- var stime: u64 = 0;
- var start_ticks: u64 = 0;
- var index: usize = 0;
- while (fields.next()) |field| : (index += 1) {
- switch (index) {
- 11 => utime = std.fmt.parseInt(u64, field, 10) catch return null,
- 12 => stime = std.fmt.parseInt(u64, field, 10) catch return null,
- 19 => start_ticks = std.fmt.parseInt(u64, field, 10) catch return null,
- 21 => return .{ .cpu = utime +| stime, .start = start_ticks, .rss = std.fmt.parseInt(u64, field, 10) catch return null },
- else => {},
- }
- }
- return null;
+ const stat = @import("../system_monitor/proc.zig").readStat(pid, &buf) orelse return null;
+ return .{ .cpu = stat.cpu, .start = stat.start, .rss = stat.rss };
}
+
fn nowNs() u64 {
var ts: c.struct_timespec = undefined;
if (c.clock_gettime(c.CLOCK_MONOTONIC, &ts) != 0) return 0;
diff --git a/src/launch_feedback.zig b/src/launch_feedback.zig
index a759584..300783b 100644
--- a/src/launch_feedback.zig
+++ b/src/launch_feedback.zig
@@ -87,6 +87,13 @@ pub fn busy(self: *const Self) bool {
return self.len > 0;
}
+pub fn pendingDesktop(self: *const Self, desktop_id: []const u8) bool {
+ for (self.launches[0..self.len]) |*launch| {
+ if (std.mem.eql(u8, launch.desktop_id.get(), desktop_id)) return true;
+ }
+ return false;
+}
+
/// The next launch started from `origin`. Call `clearOrigin` once the launch
/// call returns, in case it failed before `begin`.
pub fn setOrigin(self: *Self, origin: Origin) void {
diff --git a/src/network/manager.zig b/src/network/manager.zig
index b5d50be..d7bb98f 100644
--- a/src/network/manager.zig
+++ b/src/network/manager.zig
@@ -197,7 +197,7 @@ pub const Manager = struct {
self.publishOffline();
self.publishPresence();
if (self.server.input.open_wifi) |popup| popup.changed();
- if (self.server.input.open_control_center) |cc| if (cc.page == .network) cc.refresh();
+ if (self.server.input.open_control_center) |cc| if (cc.showingPage(.network)) cc.refresh();
}
fn reset(self: *Manager) void {
self.epoch +%= 1;
@@ -287,7 +287,7 @@ pub const Manager = struct {
self.state = try body.uint32();
self.publishOffline();
}
- const settings_open = if (self.server.input.open_control_center) |cc| cc.page == .network else false;
+ const settings_open = if (self.server.input.open_control_center) |cc| cc.showingPage(.network) else false;
// Adapters and cables coming and going decide which taskbar items show;
// access-point churn does not, so it only matters while a page is open.
const iface = msg.headers.interface orelse "";
diff --git a/src/pdf/main.zig b/src/pdf/main.zig
index f8e56f3..8975264 100644
--- a/src/pdf/main.zig
+++ b/src/pdf/main.zig
@@ -283,6 +283,7 @@ pub const Client = struct {
.close => {
self.app.requestClose();
},
+ .configure_bounds, .wm_capabilities => {},
}
}
diff --git a/src/share_picker/client.zig b/src/share_picker/client.zig
index ef4d9de..106f7cf 100644
--- a/src/share_picker/client.zig
+++ b/src/share_picker/client.zig
@@ -237,6 +237,7 @@ const Client = struct {
self.decision = .cancel;
self.running = false;
},
+ .configure_bounds, .wm_capabilities => {},
}
}
diff --git a/src/systemd.zig b/src/systemd.zig
index 7b73c7b..1048d05 100644
--- a/src/systemd.zig
+++ b/src/systemd.zig
@@ -351,7 +351,7 @@ pub const Client = struct {
}
fn changed(self: *Client) void {
if (!self.closing) if (self.server.input.open_control_center) |cc| {
- if (cc.page == .services) cc.refresh();
+ if (cc.showingPage(.services)) cc.refresh();
};
}
/// The Services page is on screen: go live. Idempotent; the page calls it
diff --git a/src/toplevel/chrome_actions.zig b/src/toplevel/chrome_actions.zig
index b4440be..ca41a92 100644
--- a/src/toplevel/chrome_actions.zig
+++ b/src/toplevel/chrome_actions.zig
@@ -44,10 +44,8 @@ pub fn handleChromeClick(toplevel: *Toplevel, sx: f64, sy: f64, button: u32) voi
}
}
-// xdg-shell has no minimized state of its own, so minimizing is purely a
-// compositor-side hint: hide the frame and drop keyboard focus while the
-// client stays mapped. Taskbar.pointerPress restores it on the next chip
-// click (see Taskbar.zig).
+// The client stays mapped while minimized. xdg-shell v6 reports suspended
+// so native clients can stop background work until restore.
pub fn minimize(toplevel: *Toplevel) void {
if (toplevel.tab_hidden) {
if (@import("../window_tabs.zig").active(toplevel.server, toplevel.tab_group)) |active_tab| active_tab.minimize();
@@ -71,7 +69,10 @@ pub fn minimize(toplevel: *Toplevel) void {
adapter.xsurface.setMinimized(true);
adapter.xsurface.restack(null, .below);
},
- .xdg, .placeholder, .shell => {},
+ .xdg => |*adapter| {
+ _ = adapter.xdg_toplevel.setSuspended(true);
+ },
+ .placeholder, .shell => {},
}
// Move to the back of the stack so the taskbar's active-window mark and
@@ -113,7 +114,10 @@ pub fn restore(toplevel: *Toplevel) void {
toplevel.frame_tree.node.setEnabled(@import("../window_tabs.zig").visible(toplevel));
switch (toplevel.backend) {
.xwayland => |*adapter| adapter.xsurface.setMinimized(false),
- .xdg, .placeholder, .shell => {},
+ .xdg => |*adapter| {
+ _ = adapter.xdg_toplevel.setSuspended(false);
+ },
+ .placeholder, .shell => {},
}
toplevel.server.world.focus(toplevel);
toplevel.syncForeign();
diff --git a/src/ui/layout.zig b/src/ui/layout.zig
index 03f4272..c29e2d0 100644
--- a/src/ui/layout.zig
+++ b/src/ui/layout.zig
@@ -169,6 +169,8 @@ pub const pill_pad_y: f32 = 2;
pub const TextStyle = struct {
sensitive: bool = false,
content: []const u8,
+ /// Case-insensitive query words highlighted behind this label.
+ highlight_query: []const u8 = "",
font_size: f32,
weight: u32 = 400,
color: [4]f32,
diff --git a/src/ui/paint.zig b/src/ui/paint.zig
index c7a5543..f6ff4e9 100644
--- a/src/ui/paint.zig
+++ b/src/ui/paint.zig
@@ -284,6 +284,29 @@ pub const Renderer = struct {
.w = @intFromFloat(@round(w)),
.h = @intFromFloat(@round(h)),
};
+ if (style.highlight_query.len > 0) {
+ const pal = r.palette orelse theme.global;
+ // Use the same face, scale and hinted advances as the label. Keep
+ // highlights inside its box, including when the label ellipsizes.
+ const limit = text_mod.measureWidthF(style.content, font, style.font_size, r.scale) catch 0;
+ const ellipsis = if (limit > w) text_mod.measureWidthF("…", font, style.font_size, r.scale) catch 0 else 0;
+ const metrics = text_mod.verticalMetrics(font, style.font_size, r.scale) catch text_mod.VMetrics{ .ascent = style.font_size, .descent = 0 };
+ const line_h = @min(h, metrics.ascent + metrics.descent);
+ var words = std.mem.tokenizeAny(u8, style.highlight_query, " \t\r\n");
+ while (words.next()) |word| {
+ if (word.len > style.content.len) continue;
+ for (0..style.content.len - word.len + 1) |i| {
+ if (!std.ascii.eqlIgnoreCase(style.content[i..][0..word.len], word)) continue;
+ const left = text_mod.measureWidthF(style.content[0..i], font, style.font_size, r.scale) catch continue;
+ const right = text_mod.measureWidthF(style.content[0 .. i + word.len], font, style.font_size, r.scale) catch continue;
+ const clipped_right = @min(right, w - ellipsis);
+ if (clipped_right > left) r.fillRect(@as(f32, @floatFromInt(rect.x)) + left, y + (h - line_h) / 2, clipped_right - left, line_h, .{
+ .color = .{ pal.accent[0], pal.accent[1], pal.accent[2], 0.25 },
+ .radius = 2,
+ });
+ }
+ }
+ }
text_mod.drawOpts(r.pixels, r.width, r.height, style.content, toColor(style.color), r.scale, font, style.font_size, .{ .rect = rect, .sensitive = style.sensitive, .device_clip = r.textClip(r.effectiveClip()) }) catch |err| {
log.err("drawText: could not rasterize label: {}", .{err});
};
diff --git a/src/ui/paint_tests.zig b/src/ui/paint_tests.zig
index f12ed35..c246063 100644
--- a/src/ui/paint_tests.zig
+++ b/src/ui/paint_tests.zig
@@ -272,7 +272,7 @@ test "text clipping preserves layout at scroll edges" {
var full: [240 * 90]u32 = @splat(0);
var clipped: [240 * 90]u32 = @splat(0);
var r = Renderer.init(&full, 240, 90, scale);
- const style: TextStyle = .{ .content = "Transmission label", .font_size = 16, .color = .{ 1, 1, 1, 1 } };
+ const style: TextStyle = .{ .content = "Transmission label", .highlight_query = "TRANS label", .font_size = 16, .color = .{ 1, 1, 1, 1 } };
r.drawText(4, 4, 140, 34, style);
r.pixels = &clipped;
r.clip = .{ .x = 18, .y = 20, .w = 90, .h = 12 };
diff --git a/src/ui_tests.zig b/src/ui_tests.zig
index 461caa6..289dc71 100644
--- a/src/ui_tests.zig
+++ b/src/ui_tests.zig
@@ -1,6 +1,7 @@
// Compositor integration/unit-test root. Shared modules have separate test
// targets in build.zig; their roots cannot import compositor code.
test {
+ _ = @import("control_center/search_index.zig");
_ = @import("auto_layout.zig");
_ = @import("desktop/app.zig");
_ = @import("desktop/config.zig");
diff --git a/tests/bluetooth.py b/tests/bluetooth.py
index d7a4386..ee6a880 100644
--- a/tests/bluetooth.py
+++ b/tests/bluetooth.py
@@ -208,6 +208,13 @@ def run(scale):
fake=start_fake();wait_label('WH-1000XM5')
choose('WH-1000XM5');capture('bluetooth-restarted')
click('bluetooth_scan');wait_for(lambda:state()['scanning'],'discovery restarted')
+ # Search hides the page just like selecting another category:
+ # discovery must stop even though Bluetooth stays selected.
+ click('settings_search');ipc.type_text('volume');ui.wait_settled('control_center')
+ wait_for(lambda:not state()['scanning'],'stop discovery during global search')
+ assert find('output_volume')['role']=='row'
+ ipc.key_press('Escape');ui.wait_settled('control_center');wait_label('WH-1000XM5')
+ click('bluetooth_scan');wait_for(lambda:state()['scanning'],'discovery after clearing search')
window=next(w for w in ipc.get_windows() if w.get('app_id')=='rediwm-settings')
ipc.close_window(window['id']);ui.wait_absent('control_center')
wait_for(lambda:not state()['scanning'],'stop discovery on close')
diff --git a/tests/control_center.py b/tests/control_center.py
index 9f7d2b0..b943ba8 100644
--- a/tests/control_center.py
+++ b/tests/control_center.py
@@ -98,6 +98,108 @@ print(f'fixture,backlight,{value},{value}%,100')
# It is an ordinary, focused window with an opaque body.
window = settings_window()
assert window is not None and window["is_focused"], ipc.get_windows()
+ # Global search updates on each keystroke, keeps field focus,
+ # searches aliases, and opens the control without changing it.
+ click('settings_search')
+ ipc.type_text('natura')
+ ui.wait_settled('control_center')
+ assert named('settings_search')['text_length'] == 6
+ assert named('natural_scroll')['role'] == 'row'
+ ipc.type_text('l scroll')
+ ui.wait_settled('control_center')
+ assert named('settings_search')['text_length'] == 14
+ capture('search-results')
+ ipc.key_press('Tab')
+ ipc.key_press('Down')
+ ipc.key_press('Up')
+ ipc.key_press('Return')
+ ui.wait_settled('control_center')
+ assert ipc.get_shell_state()['control_center']['category'] == 'input'
+ target = named('natural_scroll')
+ assert target['role'] == 'toggle' and target['visible'] and not target['clipped']
+ assert named('settings_search')['text_length'] == 14
+ # Ctrl+F reopens results and selects the retained query.
+ ipc.key(29, True)
+ ipc.key_press('f')
+ ipc.key(29, False)
+ ui.wait_settled('control_center')
+ ipc.type_text('background')
+ ui.wait_settled('control_center')
+ assert named('settings_search')['text_length'] == 10
+ assert named('@Wallpaper')['role'] == 'row'
+ click('@Wallpaper')
+ ui.wait_settled('control_center')
+ assert ipc.get_shell_state()['control_center']['category'] == 'appearance'
+ wallpaper = next(w for w in widgets() if w['role'] == 'text' and w['label'] == 'Wallpaper')
+ assert wallpaper['visible'] and not wallpaper['clipped']
+ ipc.key_press('Escape')
+ ui.wait_settled('control_center')
+ assert named('settings_search')['text_length'] == 0
+ scroll_before = next(w['scroll_offset'] for w in widgets() if w['role'] == 'scroll_container')
+ click('settings_search')
+ ipc.type_text('zzzznosuchsetting')
+ ui.wait_settled('control_center')
+ assert any(w['label'] == 'No settings found' for w in widgets())
+ ipc.key_press('Escape')
+ ui.wait_settled('control_center')
+ assert named('settings_search')['text_length'] == 0
+ scroll_after = next(w['scroll_offset'] for w in widgets() if w['role'] == 'scroll_container')
+ assert scroll_before == scroll_after, (scroll_before, scroll_after)
+ page('General')
+ ui.wait_settled('control_center')
+ # Settings which depend on a different desktop mode still
+ # lead to their page with an explicit availability message.
+ click('settings_search')
+ ipc.type_text('floating apps')
+ ui.wait_settled('control_center')
+ click('@Floating apps')
+ ui.wait_settled('control_center')
+ assert ipc.get_shell_state()['control_center']['category'] == 'desktop'
+ assert any(w['label'] == 'This setting is unavailable on this device or in the current mode.' for w in widgets())
+ ipc.key_press('Escape')
+ ui.wait_settled('control_center')
+ page('General')
+ ui.wait_settled('control_center')
+ # The compact sidebar opens a full-width field above the
+ # content. Escape clears results before hiding the field.
+ edge_x, edge_y = box['x'] + box['width'], box['y'] + box['height'] // 2
+ ipc.move_cursor(edge_x, edge_y)
+ ipc.pointer_button(272, True)
+ ipc.move_cursor(box['x'] + 600, edge_y)
+ ipc.pointer_button(272, False)
+ ipc.wait_for('window_geometry_settled', window_id=window['id'])
+ ui.wait_settled('control_center')
+ click('settings_search_open')
+ ui.wait_settled('control_center')
+ field_box = named('settings_search')['global_box']
+ assert field_box['width'] > 300
+ assert field_box['y'] < named('nav')['global_box']['y']
+ ipc.type_text('volume')
+ ui.wait_settled('control_center')
+ assert named('output_volume')['role'] == 'row'
+ capture('search-compact')
+ ipc.action('set_window_size', {'id': window['id'], 'width': 600, 'height': 360})
+ ipc.wait_for('window_geometry_settled', window_id=window['id'])
+ ui.wait_settled('control_center')
+ assert named('nav')['role'] == 'scroll_container'
+ assert named('settings_search')['text_length'] == 6
+ assert ui.scroll_into_view('printers')['visible']
+ ipc.action('set_window_size', {'id': window['id'], 'width': 600, 'height': box['height']})
+ ipc.wait_for('window_geometry_settled', window_id=window['id'])
+ ui.wait_settled('control_center')
+ ipc.key_press('Escape')
+ ui.wait_settled('control_center')
+ assert named('settings_search')['text_length'] == 0
+ ipc.key_press('Escape')
+ ui.wait_settled('control_center')
+ assert not any(w['name'] == 'settings_search' for w in widgets())
+ ipc.move_cursor(box['x'] + 600, edge_y)
+ ipc.pointer_button(272, True)
+ ipc.move_cursor(edge_x, edge_y)
+ ipc.pointer_button(272, False)
+ ipc.wait_for('window_geometry_settled', window_id=window['id'])
+ ui.wait_settled('control_center')
+ assert ipc.get_shell_state()['control_center']['box'] == box
# Check the first frame while the resize is held: waiting
# for settlement hides a body painted one size behind chrome.
title = next(w for w in widgets(f"window/{window['id']}") if w["role"] == "titlebar")["global_box"]
@@ -937,6 +1039,20 @@ def systemd_services(scale):
fake.stdin.write('reload-type\n'); fake.stdin.flush()
wait(lambda: ui.find('notify:alpha.service')['selected_index'] == 2, 'type update after external daemon reload')
assert count('ListUnits') == lists + 3 and count('Property:Type') == types + 1 + 45, 'a daemon reload re-reads the list and every detail'
+ # Global search covers the selected category: it must release
+ # the Services subscription until results are cleared.
+ before = count('Unsubscribe')
+ click('settings_search')
+ ipc.type_text('volume')
+ ui.wait_settled('control_center')
+ wait(lambda: count('Unsubscribe') == before + 1, 'unsubscribed while global search covers Services')
+ assert ui.find('output_volume')['role'] == 'row'
+ lists, nreads = count('ListUnits'), len(reads())
+ fake.stdin.write('change\n'); fake.stdin.flush()
+ time.sleep(.3)
+ assert count('ListUnits') == lists and len(reads()) == nreads
+ ipc.key_press('Escape')
+ wait(lambda: any('46 services' in label for label in labels()), 'Services resumes after global search')
# Leaving the page lets go: matches dropped, Unsubscribe sent, later
# signals unheard, and coming back loads afresh.
subscribes, lists, before = count('Subscribe'), count('ListUnits'), count('Unsubscribe')
diff --git a/tests/lock_screen.py b/tests/lock_screen.py
index c2f701a..38e6102 100644
--- a/tests/lock_screen.py
+++ b/tests/lock_screen.py
@@ -42,6 +42,7 @@ def run(scale, outputs, sequence=False):
for call in (
client.get_shell_state,
lambda: client.key(1, True), # Escape is no bypass
+ lambda: client.key(111, True), # Ctrl+Alt+Delete cannot launch while locked
lambda: client.key_press("XF86AudioRaiseVolume"),
lambda: client.key_press("XF86AudioMicMute"),
lambda: client.key_press("Caps_Lock"),
diff --git a/tests/printers.py b/tests/printers.py
index e91b6e8..b2b18bc 100644
--- a/tests/printers.py
+++ b/tests/printers.py
@@ -443,6 +443,20 @@ def run(scale):
scheduler.release.set()
refresh()
+ # Global search replaces the body while Printers stays selected.
+ # Its worker and CUPS activity must stop until results are cleared.
+ click('settings_search')
+ ipc.type_text('volume')
+ ui.wait_settled('control_center')
+ assert not printer_workers(process), 'global search must join the printer worker'
+ count = len(scheduler.calls())
+ time.sleep(.3)
+ assert len(scheduler.calls()) == count, 'global search must not retain CUPS activity'
+ ipc.key_press('Escape')
+ ui.wait_settled('control_center')
+ ready()
+ wait_for(lambda: len(printer_workers(process)) == 1, 'printer worker after clearing search')
+
# Leaving the page must cancel an outstanding socket deadline.
scheduler.release.clear()
scheduler.configure(fault='stall')
diff --git a/tests/shortcuts_inhibit.py b/tests/shortcuts_inhibit.py
index 1ae1c29..ebcd971 100644
--- a/tests/shortcuts_inhibit.py
+++ b/tests/shortcuts_inhibit.py
@@ -37,7 +37,8 @@ def run():
'"super+z" = "toggle_floating"\n"super+x" = "toggle_floating"\n'
if workspace_mode else '[keybinds]\n'
'"super+z" = "set_depth 2"\n"super+x" = "set_depth 0"\n') +
- '"alt+tab" = "focus_next"\n')
+ '"alt+tab" = "focus_next"\n'
+ '"ctrl+alt+delete" = "open_system_monitor"\n')
compositor, log = start_compositor(tmp, config, {
"XDG_STATE_HOME": str(tmp / "state"), "XDG_CACHE_HOME": str(tmp / "cache"),
"DBUS_SYSTEM_BUS_ADDRESS": "unix:path=/nonexistent-rediwm-test-system-bus",
@@ -127,6 +128,10 @@ def run():
vm.send("inhibit")
vm.expect_count("active", 1)
binding_inhibited(vm)
+ deletes = vm.count("key 111 1")
+ chord(29, KEY_LEFTALT, 111)
+ vm.expect_count("key 111 1", deletes + 1)
+ assert window("rediwm-monitor") is None, "System Monitor bypassed shortcut inhibition"
vm_id = window("rediwm.vm")["id"]
tabs = vm.count(f"key {KEY_TAB} 1")
chord(KEY_LEFTALT, KEY_TAB)
@@ -205,6 +210,8 @@ def run():
focus("rediwm.other")
binding_fires(other)
assert compositor.poll() is None
+ chord(29, KEY_LEFTALT, 111)
+ wait_for(lambda: window("rediwm-monitor"), "System Monitor shortcut did not resume after inhibition")
print("PASS: client exit while inhibiting")
except BaseException:
for path in tmp.glob("*.log"):