Skip to content

Switch the headful window manager from mutter to openbox - #473

Open
chruffins wants to merge 2 commits into
mainfrom
hypeship/openbox-window-manager
Open

chruffins wants to merge 2 commits into
mainfrom
hypeship/openbox-window-manager

Conversation

@chruffins

@chruffins chruffins commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Swaps the headful X11 window manager from mutter to openbox.

Mutter composites every frame Chromium presents. On non-GPU browsers, that compositing runs on the CPU and adds significant overhead under rendering load. Openbox is a stacking, non-compositing WM that provides what the headful image needs (decorations, focus, stacking, popup titlebars) without compositing.

Benchmark

Measured on a private build of this change, not re-run on this repo's tree. 8 vCPU / 8 GiB / 2 GiB /dev/shm / 1920×1080, --disable-gpu --use-angle=swiftshader. Medians of 3 trials per arm (1 for idle), order-balanced, same image and flags in both arms. Per-process CPU from /proc/<pid>/stat tick deltas at 1 Hz. All figures are percent of one CPU.

Workload Metric mutter openbox
Busy display stack total 95.4% 1.9%
Busy window manager 87.9% 0.00%
Busy chromium total 141.6% 145.3%
Busy screenshot latency p50 / p95 217 / 276 ms 165 / 212 ms
Idle display stack 10.0% 0.1%
Live view display stack 70.9% 3.7%

Chromium's CPU and frame output are unchanged across arms, so this removes overhead without skipping work.

Changes

  • Install openbox instead of mutter. Add x11-utils for xprop.
  • Ship a kernel-light openbox theme and rc.xml at /etc/xdg/openbox/. Titlebars are close-only. Minimize would unmap a popup with no taskbar to restore it.
  • Paint the root window with the previous gradient (shared/set-desktop-background.sh) before the WM starts. Every stage is bounded by timeout, so a wedged X call can't stall startup.
  • x11.WaitForWindowManager reads _NET_SUPPORTING_WM_CHECK (EWMH) instead of searching for a process name, so it works for any conforming WM.
  • Update mutter references in comments, the e2e test, and the crashed-service example in the API spec (openapi.yaml, plus the matching description in oapi.go).

Testing

  • go vet ./... and go test -race across the server module, e2e excluded.
  • Headful image builds from this branch. Smoke run of the built image: openbox and chromium are RUNNING under supervisord, _NET_SUPPORTING_WM_CHECK is set on the root window, the background gradient samples at the expected corner colors (#123250, #1a4a79), and CDP /json/version responds.
  • Not run yet: the headful e2e suite. It needs to pass before merge.

Known behavior differences

  • Fullscreen: Chromium reports window bounds of 2048×1536 under openbox versus 3840×2160 under mutter. The X root size is correct in both. openbox doesn't transiently expand the root during fullscreen. The kiosk e2e case covers fullscreen tracking.
  • Some window.open sequences can open popups stacked under the opener. This is identical under mutter and predates this change.
  • The background is painted at boot only. A later display resize may leave the root unpainted until the next boot. Not verified.

Note

Medium Risk
Changes the headful display boot sequence and window-manager behavior (CSD, resize reflow, live view CPU), though readiness is now WM-agnostic and startup paths are timeout-bounded.

Overview
Replaces mutter with openbox in the headful Chromium image to avoid CPU compositing overhead while keeping decorations, focus, and popup titlebars.

The image now installs openbox (plus x11-utils for xprop), ships kernel-light theme and /etc/xdg/openbox/rc.xml, and supervisord runs openbox instead of mutter. Before the WM starts, the wrapper runs set-desktop-background.sh to paint the blue gradient on the X root; each stage is timeout-bounded so wedged X probes cannot block boot.

x11.WaitForWindowManager replaces mutter-specific polling with an EWMH _NET_SUPPORTING_WM_CHECK probe so chromium-launcher and the wrapper work with any conforming WM. Comments, e2e resize tests, and telemetry/OpenAPI examples are updated from mutter to openbox/generic “window manager”; unit tests cover supportingWindowID parsing and stalled background-script probes.

Reviewed by Cursor Bugbot for commit 3dc8a83. Configure here.

Mutter composites every frame Chromium presents, which runs on the CPU
on non-GPU browsers. Openbox is a stacking, non-compositing WM that
covers what the headful image needs: decorations, focus, stacking, and
popup titlebars.

Replace the WM readiness probe with an EWMH check on
_NET_SUPPORTING_WM_CHECK so it works for any conforming WM. Paint the
root window with a gradient before the WM starts, bounded by timeouts
so a wedged X call cannot stall startup.
@chruffins
chruffins marked this pull request as ready for review October 16, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant