Repository navigation
test: a fizzy suite for Wayland frame insets, on the protocol trace - #2
Merged
Merged
Conversation
foxnne
force-pushed
the
test/fizzy-wayland-insets
branch
2 times, most recently
from
October 9, 2026 18:03
791c2a4 to
eb7e688
Compare
7 of 23 tasks
The suite for patch 6 ("Wayland: frame insets, for a shadow the application draws round its own
decorations"), `FizzyWayland` in test/testautomation_fizzy_wayland.c. Each test reconnects SDL to
the compositor with libwayland's request trace on (WAYLAND_DEBUG=client), stderr captured to a
file and libdecor off, makes a resizable borderless window with insets 24/6/30/40 round a 400x300
surface, presents into it with the GPU API so it maps, then parses the requests SDL sent on its
own objects (found by id with wl_proxy_get_id) at marks it wrote into the trace:
- floating: xdg_surface.set_window_geometry is the frame, the input region one rectangle, the
frame and a band of min(inset, 8) round it, the published SDL_PROP_WINDOW_WAYLAND_FRAME_INSET_*
are those asked for, xdg_toplevel.set_min_size/set_max_size are the frame's, and all of it
follows SDL_SetWindowSize;
- maximized and fullscreen: the published insets are 0, the surface is the configured size, the
window geometry the whole surface and the input region nil; restored, the insets come back;
- a tooltip popup's positioner is anchored to the parent's frame, its offset less the parent's
left and top insets, and SDL reports the popup where it was asked for.
On a release without the patch the properties are defined here, so the suite builds there and
fails on its first checks: nothing is published and no window geometry is sent.
Part of fizzyedit/fizzy#280 (step A2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
foxnne
force-pushed
the
test/fizzy-wayland-insets
branch
from
October 9, 2026 18:55
eb7e688 to
a518aaf
Compare
foxnne
marked this pull request as ready for review
October 9, 2026 19:17
foxnne
added a commit
to fizzyedit/fizzy
that referenced
this pull request
Oct 9, 2026
…294) Fixes #289. Part of #280 (steps A1, A2 and A4b landed on the forks). Moves fizzy's `.sdl` pin to sdl_zig `fizzy-1.0.3+3.4.16-8` (SDL `fizzy-3.4.16-8`). That brings two things: **1. The forks carry tests now.** fizzyedit/SDL has fizzy's own suites on SDL's test harness, one per patch, each failing without its patch. fizzyedit/sdl_zig runs them with `zig build test-fizzy` in CI: Linux on lavapipe under Xvfb and headless weston, and the hosted macOS runners, which have a Metal device. - fizzyedit/SDL#1 → `fizzy-3.4.16-6` (`4839ede`): the runner, plus patch 1's suite (transparent window claimed on Metal and Vulkan). - fizzyedit/sdl_zig#1 → `fizzy-1.0.3+3.4.16-6` (`0f6a2a8`): the `test-fizzy` step. - fizzyedit/SDL#2 → `fizzy-3.4.16-8` (`a518aaf`), fizzyedit/sdl_zig#2 → `fizzy-1.0.3+3.4.16-8` (`a02dda8`): patch 6's suite, Wayland frame insets. - **How:** it reads libwayland's request trace under headless weston, at scale 1 and 2. - **Checks:** geometry, input region, min/max sizes and published insets while floating; zero insets when maximized or fullscreen; popup anchoring. - **Result:** passes on the fork, and fails on upstream 3.4.16. - **Problems it found in patch 6:** five, listed in #280 (C2b). **2. SDL patch 8: Wayland loads where libxkbcommon is older than 1.10** (#289). - **The bug:** built against 1.10+ headers (sdl_zig uses 1.13), SDL required `xkb_keymap_mod_get_mask()`. On Ubuntu 24.04 (1.6) or Debian 12 (1.5) the whole Wayland driver reported itself unavailable, and fizzy fell back to X11. Upstream `main` has the same problem. - **The fix:** the symbol is now optional at runtime, and the masks fall back to `xkb_keymap_mod_get_index()`, the path SDL already takes when built against older headers. For standard keymaps both paths give the same masks. - **The proof:** - [red](https://github.com/fizzyedit/sdl_zig/actions/runs/37968707700) on `ubuntu:24.04` without the patch ("wayland not available"); - [green](https://github.com/fizzyedit/sdl_zig/actions/runs/37971005996) on 24.04 and 26.04 with it, where a German keymap's Shift, Caps Lock and AltGr levels come out right. - **The PRs:** fizzyedit/SDL#3 → `fizzy-3.4.16-7` (`36dda37`); fizzyedit/sdl_zig#3 → `fizzy-1.0.3+3.4.16-7` (`264af2a`). `docs/DEPENDENCIES.md` records patch 8, the three suites, sdl_zig's step and CI jobs, all six tags, and each patch's check at a rebase. ## Verified On macOS (arm64), in a fresh workspace on `main`: | Gate | Result | |---|---| | `zig build` | 43/43 steps | | `zig build test` | 75/75 steps | | `zig build test-integration` | 33/33 steps, 347/347 tests | | `zig build check-web` | 16/16 steps | | `zig build test-sdk-version` | 12/12 steps | | `zig build -Dtarget=x86_64-linux-gnu` | 54/54 steps (builds the patched Wayland file) | Not verified: a fizzy binary running on a real Ubuntu 24.04 Wayland desktop. The evidence is the fork suite in CI containers, built from the same sdl_zig. The SDK fingerprint doesn't move, since plugins never link SDL. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of fizzyedit/fizzy#280 (step A2). Test files only: no library code changes. Run by fizzyedit/sdl_zig#2.
The suite for patch 6, "Wayland: frame insets, for a shadow the application draws round its own decorations" (2d6efde):
test/testautomation_fizzy_wayland.c, suiteFizzyWayland, plus one line each intestfizzy.candtestautomation_fizzy.h.How it observes
Each test reconnects SDL's video to the compositor with libwayland's request trace on (
WAYLAND_DEBUG=client), stderr redirected to a temporary file andSDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR=0, so the window is a plain xdg-shell toplevel. It makes a resizable, borderless window (as fizzy's Linux backend does) with insets left 24, top 6, right 30, bottom 40 round a 400x300 surface. Every side differs, and the top is under the 8-unit input band. It presents frames with the GPU API so the window maps, and writes a mark into the trace at each checkpoint. Afterwards it parses the requests SDL sent on its own objects, found by id withwl_proxy_get_id, plus the toplevel'sconfigureevents. It asserts once stderr is back, then logs the trace lines for its objects, so a CI failure can be read without rerunning it. Video is reference-counted, so the suite shuts it down as many times as it was brought up and restores it after.What it asserts
wayland_frameInsetsFloating:xdg_surface.set_window_geometryis the frame,(24, 6, 346, 254). The input region is onewl_region.add, the frame plus a band of min(inset, 8) on each side,(16, 0, 362, 268). The publishedSDL_PROP_WINDOW_WAYLAND_FRAME_INSET_*_NUMBERare those asked for, andSDL_GetWindowSizeis the surface. With min/max 200x150 and 800x600,xdg_toplevel.set_min_size/set_max_sizeare 146x104 and 746x554, the frame's. AfterSDL_SetWindowSize(500, 380), geometry, input region and props all follow.wayland_frameInsetsMaximized: the compositor maximizes. The published insets are 0, the surface is the configured size (1024x608), the window geometry is the whole surface, and the input region isnil. After restoring, the window floats at 400x300 and the floating checks pass again.wayland_frameInsetsFullscreen: the same for fullscreen (1024x640).wayland_frameInsetsPopup: for a tooltip popup at (50, 60) of the parent, the positioner'sset_anchor_rectis the parent's frame(0, 0, 346, 254)andset_offsetis(26, 54), the position minus the parent's left and top insets. SDL reports the popup back at (50, 60).On a release without the patch the property names are defined in the suite, so it builds there and fails on its checks instead of crashing.
Verified
test-fizzy-wayland-insets (1)/(2)). A1'stest-fizzy-linux (wayland)job runs the suite too, and it passes there.got: -1 (not published)), noset_window_geometryis ever sent (upstream sends none when there is a viewport), the input region is never set, min/max are sent as 200x150 / 800x600, and the popup is anchored to(0, 0, 400, 300)at offset(50, 60).-Wall -Wextra -Wmissing-prototypes -Wmissing-variable-declarations -Wshadowfor x86_64-linux, aarch64-macos and x86_64-windows, against both fork and upstream headers.Not covered (what headless weston can't do)
width += il + ir) never runs. Only maximize/fullscreen sizes, where the insets are zero, come from the compositor.tiled_*, so "tiled ⇒ no insets" is untested.wp_fractional_scale_v1here.The SDL commit needs a permanent tag before sdl_zig's pin on it merges.
🤖 Generated with Claude Code