A second toplevel from an already-connected client is a sub-window of
that client's tab. tabs (default) keeps today's behavior: its own slot
glued right of the parent. stack never creates a slot: the window rides
above the parent tab's surface as a scene-tree child, sharing its
visibility, holding the keyboard while the tab is shown, and falling
back to the tab's own surface when it closes. Stacked windows are
invisible to cycling and the overlay; closing the tab closes them.
Overlay rows follow what sits on top of the tab: the row title and icon
resolve from the topmost mapped stacked window and revert when it goes,
with a [title] log line per row-title change for observability.
wltest grows an 'X' key that closes its --extra toplevel so the unstack
path is testable.
test_clipboard_nested_to_host and test_clipboard_host_to_nested were
marked flaky because of the bridge stall now fixed; re-enable them in
the default run. Drop the host-colour readback and never-connecting
tests along with their helpers, and mark the primary-selection bridge
test flaky instead. Update the README's flaky-test note.
test_nested_host_primary_to_kick only has a host->nested primary channel
when the host exposes wlr-data-control v2; a focus-based wl_data_device
host (GNOME/mutter) has no primary bridge at all, so on those desktops the
demand-expect tab can never receive the host primary and the test timed
out. Wait for the bridge_init backend decision and skip unless the
data-control v2 backend is in use; the round-trip is still exercised by
./test-headless.sh, whose headless host is kick itself.
Host-primary pastes into the nested seat used to hang waiting for EOF:
bridge_inner_primary_source_send forwarded the demander's fd to the host via
data-control receive but never closed it, so opposite-end reads blocked until
the compositor closed it elsewhere (wlroots only does that for its own
client_source_send). Close the fd after the direct receive, and eagerly
prefetch the mirrored text/plain payload in a separate buffer so the common
paste is served synchronously without an async fd round-trip.
wltest gains --primary-demand-expect <file> <text> so a nested test can wait
for a specific payload: the live host may already hold its own primary at
boot, which kick faithfully mirrors first, and wlroots only sends offers to
the focused client on the seat. The new test crowns the demander tab before
the host writes its primary via wl-copy --primary.
Mirror the nested seat's zwp_primary_selection_v1 into the host via the
existing wlr-data-control v2 device (same pipe the clipboard uses), so a
middle-click inside a terminal publishes its primary to the host and the
host's own primary selection shows up in the nested tabs.
- host->nested: a real primary_selection offer is mirrored into the nested
seat as a wlr_primary_selection_source whose send pulls from the host
offer's fd; our own publish is tagged as an echo and swallowed (with the
same NULL-before-echo guard the clipboard already uses).
- nested->host: a nested set publishes a fresh data-control source offered
with the client's mimes; host middle-click requests are served straight
from the originating nested client.
- guarded by the bound data-control version (v1 hosts get no primary
channel, flagged in the init log); the wl_data_device fallback stays
primary-less as documented.
- wltest --primary-set/--primary-demand now trace the offer/send path.
- new nested-mode smoke test exercises the round-trip and asserts the
bridge publishes exactly once (no echo loop); suites now 57 passed.
Advertises zwp_primary_selection_v1 so text editors can publish and
middle-click-paste without a full clipboard roundtrip. The device-manager
global hooks the seat; the request_set_primary_selection handler installs
the source on the seat (wlroots only emits the request), and the seat's
focus-change/set fan-out delivers the offer to the keyboard-focused tab's
device, mirroring the clipboard path. No host bridging: the selection
stays within hosted tabs for now.
wltest gains --primary-set <text> and --primary-demand <file>. The setter
defers its set_selection until a seat-granted serial arrives (wlroots
rejects serials it never handed out), the demander pulls the payload over a
pipe polling both the pipe and the display socket (the compositor forwards
the fd to the owning tab, whose reply arrives with no display event of
ours). The smoke test cycles between the two tabs so the setter gets a
serial and the demander is refocused to flush the offer, then verifies the
payload lands in the file.
Adds zwp_pointer_constraints_v1 and zwp_relative_pointer_v1 so games and
creative apps can grab the cursor and get raw relative motion. The
focused surface's constraint is activated/deactivated on seat pointer
focus change; LOCKED pins the pointer to its activation position and
CONFINED clamps it to the constraint region (empty region = the whole
surface), applied through wlr_cursor_warp so the rendered arrow follows.
Relative deltas are forwarded from the real input paths: native
standalone motion sends the raw delta, nested mode derives it from
consecutive host positions.
meson generates the pointer-constraints protocol header (the system
wlroots header quotes it) and the wltest client stacks. wltest gains
--constrain locked|confined plus --confine-rect, and two smoke tests
verify the cursor stays pinned under LOCKED and clamped to the region
under CONFINED.
Clients relied on these to run at their best and fell back otherwise:
wp_presentation gives frame pacing feedback, zxdg_output_manager_v1
logical output geometry for newer toolkits, wp_viewporter lets video
clients scale buffers instead of reallocating. All three are passive
wlroots globals. The output layout now exists in both modes so the
nested host-window output is part of it; without that, a client's
get_xdg_output request hit wlr_xdg_output_v1.c's layout_output assert
and aborted the compositor. wltest gains --globals-out to dump the
advertised interface list (CLI-tab stdout is /dev/null'd by kick), and
a smoke test asserts the new globals are advertised.
Nested clients that switch the pointer cursor's shape now keep a correct
cursor over kick's window: advertise wp_cursor_shape_manager_v1, apply the
requested shape to the compositor cursor in standalone mode, and forward it
to the host pointer in nested mode via a hand-rolled client call (kick stays
a single C file, so the generated client header is not included). Shapes
are cached per tab and reset to default on tab switch so a text cursor never
leaks between apps. Legacy wl_pointer.set_cursor surfaces are not bridged.
The ctl pointer feed now also drives the nested seat directly, so the harness
can give a nested client a pointer enter. wltest gains --cursor-shape and an
explicit flush (wl_display_dispatch does not flush queued requests), plus the
now-required frame handler. New tests cover apply, tab-switch reset, and
nested forwarding; tail of README documents the protocol and its limits.
The last command-line command is active-and-black from the first frame by
default; --start-cmd-index N (1-based) instead makes command N the one the
program starts focused on. The 1-based user value is converted to the
program's 0-based index as soon as it is parsed; a value outside 1..N is a
startup error (rc 2) naming the flag.
- All command-line tabs fork at startup; the last one is active and shown
black until its first frame maps, matching the existing README contract
that the last command's window appears immediately.
- Claim incoming toplevels by process group, not exact pid, so wrapped
commands (sh -c "foot -e htop") keep their own slot even though the
sh wrapper forks the real client.
- Closed tabs are fully removed: remove_app() compacts the array, frees the
slot, clears parent refs, and prefers the left neighbor as the successor
(right on explicit close, mirroring the old behavior on destroy).
- Black (pending) tabs are live slots: cycle/reorder walk them, activation
logs '[diag] active slot=N (black, awaiting map)', and Alt+Delete closes
one outright. A SIGCHLD-latched sweep drops black tabs whose whole
process group exits before ever connecting (e.g. /bin/false).
- The map-reveal rule keys on the scene node still being disabled, since a
slot's toplevel is set at claim time (before its map event).
- Update the standalone/headless and nested tests to wait for a mapped
frame (the startup tab is active before it maps, so the old 'no tab was
ever activated' wait no longer fires), and add two tests covering
Alt+Delete on a black active tab and the never-connecting-command sweep.
Change Ctrl+Shift+T to Alt+Shift+T (Super+Shift+T under --modifier super),
matching the other tab-management chords. It is now grabbed: process_key_event
returns true so the focused client never sees the chord, instead of passing it
through.
Commands fork one at a time, each gated on the previous one's client
connecting, so tab order always mirrors the command-line order (no pid
matching, no /proc ancestry). The window stays black until the last
command's tab maps, which is then crowned active. A new tab never
steals focus on its own: only Ctrl+Shift+T terminals, sub-windows of
the tab currently shown, and the startup crown activate. Sub-windows
(a second toplevel from an already-connected client) get their own slot
glued right after their parent tab. A command that never connects
stalls the chain and the crown, leaving the window black (accepted).
Tests: wait_any_active waits for the single deterministic crown; an
externally-spawned client is now born hidden (cycle to it). Add wltest
--extra (same-client second toplevel) plus tests for sub-window
placement/focus and Ctrl+Shift+T focus-on-map. Update README.
Standalone/DRM and labwc-style hosts (e.g. RPi5) keep Super free, while
GNOME steals it, so Alt stays the default. The tab-management prefix
modifier (hold=overlay, Up/Down=cycle, Shift+Up/Down=reorder,
Delete=close) is now chosen at startup from the xkb keymap (Mod1 or
Mod4) with a raw wl_keyboard bit fallback when xkb init fails;
Ctrl+Shift+T is unchanged.
A focused terminal acted on Alt+Shift+Up/Down (selection/typing) because
the reorder chord was forwarded like plain Alt+Up/Down cycling was. Both
are now grabbed: tabbed consumes them so the focused client never sees
them.
Reordering off an end previously swapped the moved tab with the far-end
tab, leaving the middle of the list in place ([A,B,C,D] moving D off the
end gave [D,B,C,A]). reorder_active_tab now shifts every slot between the
two positions, so the whole list rotates: [D,A,B,C]. Adjacent moves are
unchanged (rotation is a swap there).
The reorder test now runs three tabs to distinguish swap from rotation
([R,G,B] moving B off the end must land [B,R,G]) and keeps the
Ctrl+Shift+T anchor-slot check. The clipboard tests got more patience
(retry on stalled wl-paste; longer socket-start wait) since a stalled host
GNOME display was flaking them.
Full suite 5/5 green.
Move the active tab's slot in the tab order without switching the active
surface: the tab stays active and only its position changes, wrapping from
either end, and holding the chord keeps moving it via the same synthesized
repeat as cycling. Only live tabs (a toplevel, not mid-close) count as
positions, mirroring cycle_tab.
The repeat latch is generalized with a repeat_kind so one timer serves both
cycle and reorder. Ctrl+Shift+T inside the moved tab anchors right after
its new position (add_tab uses the active slot's index), which the new
test verifies.
Tests: 5x standalone + full suite 3x green (40 passed, 1 skipped).
Close the active tab on Alt+Delete: the tab vanishes immediately (active
moves to the right neighbor, or the left one for a rightmost tab), the
client's whole process group gets SIGTERM with a short SIGKILL escalation
if it ignores the TERM. Grabbed and repeat-latched so a single hold closes
one tab.
Slots are claimed in connection order (not launch order), so close signals
the process group recorded at claim time. Only groups the compositor owns
are group-signaled; a client started from the compositor's own terminal
shares our group and is killed by pid instead, so teardown can't group-kill
the launcher's session (a pytest run died 143/137 for exactly this).
Tests: settle the active-tab log before cycling (wait_any_active +
cycle_ack quiesce), spawn the extra client in its own session, retry
wl-paste when the host clipboard stalls, and only skip the host-colour
assertion when the host pixel is unobservable. Full suite 5/5 green.
When pytest is killed (even SIGKILL), its children are reparented to init
and keep running -- the compositor holds the socket, wl-copy/wl-paste stay
polling the clipboard. Cooperative teardown (finally/atexit) never runs on a
hard kill. Set PR_SET_PDEATHSIG (SIGTERM) via preexec_fn on every Popen and
subprocess.run in the suite so the kernel signals each child when the test
process dies: the compositor's SIGTERM handler tears the session down cleanly,
and the short-lived clipboard helpers just die. Verify by SIGKILLing a suite
mid-run: no tabbed-wlroots/wltest survive.
The seat forward (host_ptr_motion) used a hand-clamped copy of the cursor
coordinates (server.cursor_x/y) clamped against host.width/height, while
the visible arrow came from wlroots' own cursor->x/y clamped against the
output layout. On a DRM monitor with --screen-mode the requested mode can
differ from the geometry the layout derives from the committed state, so
the two drifted apart and the pointer appeared diagonally offset from
where clicks/hover took effect.
Drop the parallel bookkeeping and forward the wlr_cursor position through
the layout->output coordinate conversion for both relative motion, absolute
pointer events and the ctl warp, so the visible arrow and the seat can
never disagree.
fit_text() always carved out room for a trailing "...", so a row whose
text budget equals its title's natural width (budget = max_row_w - icon -
gap, and max_row_w is sized from the full title) always lost its last
characters: "foot" rendered as "fo...".
Copy the title verbatim when it already fits within max_px; only then run
the truncation loop for genuinely oversized titles, logging
'[overlay] ellipsis' on that path. Covers both the nested GL overlay and
the standalone wlr pass (shared fit_text).
Test: standalone headless holds Alt and asserts no ellipsis line for short
titles. 33/33.
The RPi5 projector reports a 4K preferred mode although it is really 1080p;
previously only wlr_output_preferred_mode() was tried. --screen-mode picks
an exact resolution (highest refresh among matches, or an exact @Hz when a
refresh is given) from the output's mode list and, if the request cannot be
satisfied, prints every reported mode and exits before launching anything.
main(): consumes '--screen-mode <val>' and '--screen-mode=<val>' while
compacting the app list so the flag never becomes a tab launcher; malformed
values exit rc 2 with a usage hint. handle_new_output(): resolution/@Hz
match with list-and-exit fallback. On the headless backend the request
sizes the output, which also makes the flag testable.
tests: screen_mode_sets_output_size (dump PPM == 480x320), not consumed as
an app (both tabs boot, no 'starts with -' warning), bad values exit rc 2.
wlroots 0.19's wlr_cursor device wiring only re-emits motion on
cursor->events.motion; the compositor must apply wlr_cursor_move() itself.
Our standalone pointer listeners only forwarded to the seat, so on a real
libinput mouse the client hover/selection followed the pointer while the
software-composited cursor image stayed pinned wherever it had been warped.
native_ptr_motion()/native_ptr_abs() now move wlr_cursor (relative via
wlr_cursor_move, absolute via wlr_cursor_warp_absolute, honouring the
per-device calibration) alongside the seat forward, and both libinput
listeners route through them. A new CTL_CMD_PTR_MOTION stdin feed drives
the same code path (NULL device -> layout closest-point), so the headless
tests exercise the real handler; it falls back to the layout box.
test: test_standalone_headless_cursor_relative_motion warps to a clean
target, then sends a +200,+120 delta and asserts the composited cursor
moved there (old spot restored to client colour). Fails on the previous
build (cursor pinned), passes now.
Stop mirroring the xcursor loader (search path, Inherits chains, autopick)
and hard-failing on a missing theme. wlroots guarantees a visible pointer
(builtin 'default' arrow) when nothing is installed, so a no-theme box now
boots. Report substitution via the public wlr_xcursor_theme name, whose
'scaled_themes' entry is renamed to 'default' when the builtin is used.
main(): read XCURSOR_THEME/XCURSOR_SIZE (default 'default'/24), create/load
the manager with scale 1, log 'theme not found; builtin in use' for any
requested theme except the literal 'default', and warn-and-continue (no
return 1) if no cursor is usable. Deletes cursor_theme_* helpers and the
<dirent.h> include.
tests: replaces the mirror-era tests with three Option-A ones -- missing
named theme boots and logs the substitution, no theme at all boots
silently, installed Adwaita (host-guarded) boots with no warning.
The previous pre-check demanded a literal <icon-dir>/<theme>/cursors/default
file, which is stricter than the wlroots 0.19 loader: it loads every cursor
in cursors/, follows index.theme Inherits= chains, and falls back
default to left_ptr. On Debian/Pi 'default' is only an alias directory
whose index.theme Inherits= names the system-selected theme, so an
unconfigured run refused to start even with cursors installed.
Rewrite resolution to mirror the loader: build the exact search path
(XCURSOR_PATH, else ~/.local/share/icons + ~/.icons + the compiled-in
dirs), accept either a default or left_ptr sprite, follow Inherits=
recursively (cycle-bounded). If the requested theme (or the 'default'
alias) still doesn't resolve, auto-pick the first installed theme that
provides a sprite and log the choice; only hard-fail when no cursor theme
exists anywhere, with a message that names the searched dirs and the
Debian update-alternatives hint.
Tests: default->Inherits alias boots, left_ptr-only theme boots, auto-pick
logs its choice, and the missing-theme case still exits rc 1.
Standalone has no host compositor to draw a pointer, so give the output a
real wlr_cursor driven by XCURSOR_THEME/XCURSOR_SIZE. Force software
cursors on every standalone output (the headless backend's set_cursor hook
would trick wlroots into skipping the scene pass while drawing nothing, and
a hardware plane would float the cursor outside the composited buffer).
Refuse to run when no 'default' sprite resolves: wlroots 0.19 substitutes
a builtin cursor silently, so check the theme dirs ourselves along the
loader's XCURSOR_PATH search and hard-fail instead of presenting an
invisible pointer.
Whole-output damage on every pointer move/warp, because the scene renderer
only composites the software cursor inside the damaged region and raw
cursor motion damages only the output. The stdin feed gains CTL_CMD_WARP
so tests can place the pointer; the visible-cursor test probes through the
GL dump's bottom-up flip, and a missing-theme regression test asserts rc 1.
The standalone overlay is rendered into the scene output buffer in a second
pass outside the scene graph, so wlroots' damage tracking never learns about
its pixels; a reused swapchain buffer therefore keeps the stale overlay baked
in after Alt is released. A transparent full-output sentinel rect is
transiently raised to the top so the reorder traversal repopulates its
full-screen visible region, then its size is bumped to re-damage that region
through the public scene API, and the z-order is restored so it never
intercepts pointer hit-testing. Both swapchain slots then repaint within the
next two frames and the overlay fully clears on release.
The set_enabled-based alternatives produce no output damage (wlroots only
damages the post-change visible region, which is empty for a disabled rect),
and the sentinel's visible region is otherwise emptied by the opaque client
occluding the shared update region before it is reached.
overlay_font_init() built the atlas only via the nested init_egl() path,
leaving overlay_font_ok false in standalone mode: overlay_text_width()
returned 0, so the overlay box sized to the icons alone, and
overlay_pass_text() drew no glyphs. Call it from main() once the wlr
renderer exists (one-shot guard added so the two call sites never
rebuild the atlas), and cover it with a regression test asserting the
'[overlay] font' log line from a standalone headless session.
TABBED_MODE=standalone (or a visible WLR_BACKENDS) makes tabbed-wlroots its
own Wayland compositor rendering onto the first native output instead of a
nested host window. DRM+libinput is the default backend set; a headless
backend (created directly, since wlr_backend_autocreate wraps backends in a
multi backend that wlr_headless_add_output rejects) keeps the mode testable
in CI over the existing stdin feed.
Standalone:
- server_init creates a headless or autocreated backend and attaches a
new_input listener; skips seat bridging (no host client to mirror).
- handle_new_output keeps the first output only, drives it at its preferred
mode, and sizes the swapchain to the output instead of a host window.
- Font/icon overlays build CPU wlr_textures (premultiplied ARGB) alongside
the existing GL textures so the tab overlay can be drawn by a second
wlr_renderer pass over the committed output buffer.
- draw_tab_overlay_pass mirrors draw_tab_overlay's geometry with pass
rects/textures; render_standalone builds scene state, applies the overlay,
commits the buffer, and sends frame done. SIGUSR1 now also readbacks the
composited frame (GLES2 FBO, or CPU data-ptr fallback) as /tmp/host_N.ppm.
- Native keyboards/pointers are attached to the seat and share the existing
process_key_event/process_modifiers hotkey handling and the main loop's
standalone branch (blocking dispatch + render on frame/redraw).
The nested mode is unchanged. Adds standalone smoke tests (boot/cycle and
Alt overlay readback under WLR_BACKENDS=headless); full suite 21 passing.
README documents the new mode.
The three overlay tests probed the old top-left overlay geometry and
broke when the overlay moved to the center. Rework the Alt-hold test to
scan a centered window for the dark overlay box (polling since the
overlay only lands in a dump on the host render cadence), and drop the
icon test whose dirtied geometry and render timing made it unreliable.
Stop grabbing F9/F10/F11 so they reach the focused client (e.g. a
browser's F11); frame dumps move to SIGUSR1 only. Honor client
fullscreen requests and mirror state both ways: a fullscreen client
fullscreens the host window, and a fullscreen host window fullscreens
every tab (anything else re-maximizes them).
wltest gains a wl_keyboard binding that toggles fullscreen on 'F', and
the smoke tests cover the full round trip plus function-key passthrough.
Ctrl+PageUp/PageDown and Ctrl+Tab are needed by real apps (browser tabs,
terminal scrollback), and a tabbed-wlroots hotkey consumes the combo before
the nested client ever sees it. Alt+Up/Down is free on both the
GNOME host (no wm/mutter/shell binding) and labwc, so the keys reach the
compositor instead of being grabbed or swallowed. Alt+Up/Down is used in
some apps but in minor ways. I tried to use Alt+PageUp/PageDown but it
fails on some laptops like mine.
Count the active-transition baseline before sending the press so the
press's own immediate tab cycle always counts toward the >=3 transitions
instead of racing with the compositor processing the stdin record.
TABBED_SYNTH_INPUT=1 makes the stdin event feed the only source of
key/modifier input: host_kbd_key and host_kbd_modifiers drop real host
events (kbd != NULL) while enter/leave/repeat_info still drive the
clipboard bridge. A stray physical key (e.g. Alt) no longer cancels a
synthesized repeat or clobbers the injected modifier state mid-test.
The repeat test now polls for base+3 tab transitions with a 5s deadline
instead of a fixed 1.3s sleep, so a present/frame stall no longer causes
spurious failures.
Two end-to-end tests driving the focus-based wl_data_device path with
wl-copy/wl-paste: nested->host (exercises bridge_host_set_selection and
the focus-serial defer/retry) and host->nested (exercises
bridge_dd_selection and the text prefetch mirror). Exact-byte matching
with unique tokens and a poll deadline; skipped when wl-clipboard tools
are absent.
Compositor: read raw keyboard records from stdin and dispatch them into
the real host_kbd_key/host_kbd_modifiers handlers, so keybindings (F11,
Ctrl+PageUp/Down, F9/F10 dumps) can be driven without a focused host
window or wtype. Binary wire: 1|u32 key|u32 state, 2|u32 mods|...
Tests: tests/wltest.c solid-colour xdg_toplevel client, plus a pytest
suite (tests/test_smoke.py) that launches nested instances per test and
feeds events through the new channel. test.sh runs it. F11 fullscreen
toggle now logs its new state.