Skip to content
The record
Finding25 July 20265 min read

Making a browser fill a screen: seven attempts on a live-boot appliance

Seven approaches to full-screening a kiosk browser on hardware that is whatever came through the door, six of which failed because they needed a package the live-boot image did not carry, and the one that shipped — libX11 through python ctypes — together with the status-bar readout naming which of five launch paths actually ran, without which every failure looked identical.

systemsmethodhardware-testing

What was done

Worked through seven ways to make the kiosk browser fill a screen on hardware that is whatever came through the door. Six failed: Firefox --kiosk opens at about ninety percent and never fills, Cage is correct but is not on the image, installing Cage at boot needs a network the bench often lacks, and the window-manager and xdotool routes each need another package. The one that shipped talks to libX11 through python ctypes and resizes whatever top-level window appears to the exact screen size, using only Xorg and python3 — the lesson being that on a live-boot appliance a dependency you have to install is a dependency you do not have, now written into the session script's contract. A Display readout in the status bar naming which of five launch paths actually ran is what made the problem tractable, because until then every failure looked identical. The fix then produced its own defect: the resizer seized every top-level window including native select dropdowns, which are themselves top-level X windows, so menus snapped shut the instant they were clicked — answered by behaving like a real window manager and skipping override-redirect, non-viewable and undersized windows, and raising or focusing at most once per window.

Firefox --kiosk       opens ~90%, never fills     X
Cage (Wayland)        right, but not on the image X
install Cage at boot  needs a network             X
WM + xdotool          another package             X
xdotool resize        deterministic, still installs X
python + libX11       already on the image        OK
  via ctypes
 
every approach above the line worked on the dev
machine and failed on the bench.
 
on a live-boot appliance, a dependency you have
to install is a dependency you do not have.

The seven attempts, and what each one cost.


Status

Shipped, 19–27 July 2026.

Fifteen commits, most of them on one problem.

The problem

The audit station is an appliance. A technician boots a PC from a USB stick and should see one interface, full screen, with no desktop, no browser chrome and no way to end up somewhere else.

The machine it boots is whatever came through the door: any manufacturer, any graphics hardware, any panel resolution, sometimes no working display driver. There is no fixed target to develop against.

The attempts, in order

ApproachWhy it failed
Firefox --kioskHides the toolbar but opens at ~90% and never fills
Cage (Wayland kiosk compositor)Correct when present — not on the image
Auto-install Cage at bootNeeds a network. The bench often has none
X fallback with a window manager + xdotoolAnother dependency not on the image
xdotool window resizeDeterministic, still an install
python + libX11 via ctypesWorked. No packages, any display
ctypes and resizes whatever top-level window appears to the exact screen size.

The lesson, paid for over seven attempts: on a live-boot appliance, a dependency you have to install is a dependency you do not have. Every approach that needed a package worked on the development machine and failed on the bench. The one that shipped uses only what the image already carries — Xorg, python3 — and that constraint is now written into the session script's contract.

The diagnostics that made it tractable and added a Display readout to the status bar, showing

the resolution and which launch path was actually taken — cage, xinit or session.

Until then every failure looked the same: a window that was not full screen. Afterwards it was possible to tell which of five mechanisms had run. Most of the progress after that point is attributable to being able to see this.

A defect from the fix itself

the fullscreen enforcer must never touch popup windows.

The resizer grabbed every top-level window, including dropdown menus, and resized them to fill the screen — which made a dropdown snap shut the instant it was clicked. The station had a dropdown that could not be used, and the cause was the code that made the interface work at all.

What else landed alongside

Wi-Fi connection in the GUI, then Ethernet when it turned out the bench is often wired; saving the wipe to the batch and a Shutdown control; auto-fit for any resolution; and a rebuild to a two-column console design.

What was deliberately not built

No custom compositor or display manager. The station uses the stock Ubuntu X session and resizes one window inside it.

Open questions

Superseded in September by the casper layer and the dedicated kiosk session, where GNOME never draws at all — see 2026-09-02-casper-layer-and-kiosk-session.md.


The code

The resizer's filter after the dropdown defect — the four reasons to leave a window alone.

for w in top_children():
    a = XWA()
    if not X.XGetWindowAttributes(dpy, w, ctypes.byref(a)):
        continue
    if a.override_redirect or a.map_state != IS_VIEWABLE:
        continue                      # menus/dropdowns/tooltips/hidden
    if a.width < sw * 0.6 or a.height < sh * 0.6:
        continue                      # dialogs and popups, not the kiosk
    if a.width == sw and a.height == sh and a.x == 0 and a.y == 0:
        continue                      # already perfect
    X.XMoveResizeWindow(dpy, w, 0, 0, sw, sh)
    if w not in focused_once:
        # Raise and focus only the first time: doing it every second
        # would fight whatever the operator is interacting with.
        X.XRaiseWindow(dpy, w)
        X.XSetInputFocus(dpy, w, 2, 0)  # RevertToParent, CurrentTime
        focused_once.add(w)
From tools/gui/fullscreen-x.py — an excerpt, trimmed to the technique it illustrates.

Not shown. The ctypes argtype declarations and the no-op X error handler are omitted as mechanical bulk rather than illustration, and the surrounding session scripts (the launch-path selection, the autostart chain and the Firefox profile seeding) are left out — the point of the record is the filter and the constraint, not the station's boot wiring.

A published copy. Commit references and internal identifiers have been removed and the operator is not named; the engineering, the counts and the stated limits are unchanged.