The bridged SDL_QUIT still has to survive the app's event loop; apps
that prefer determinism (or whose backend never latches pushed quit
events) can instead poll the recorded close request next to their tray
actions and run their own close flow.
SDL2 delivers the main window's close request (X button, Alt+F4, WM
delete) as SDL_WINDOWEVENT_CLOSE; the raylib SDL backend only latches
SDL_QUIT, so the close button did nothing. The event watch records
close requests for windows that are not ours, and PumpUIWindows -
called by SetUIFrame once per frame, where calling into SDL is safe -
pushes the bridged SDL_QUIT.
Borderless secondary windows had no drag support on the SDL path at
all (IsUIWindowDragged was a stub): the watch now records press,
relative motion and release, and PumpUIWindows applies the window
move, mirroring the Xlib path. GetUIWindowPosition also stops
reporting a constant 0,0.
The secondary-window presenter had no callers and no build coverage:
nothing compiled the UI_WINDOW_HAVE_SDL branch (the Wayland and
SDL-bundled path), and no test exercised the public API at all, so
recent presenter fixes could only be validated by reading the code.
- Compile ui_window.c with -DUI_WINDOW_HAVE_SDL in make test so the SDL
presenter cannot rot uncompiled.
- Add a ui_window smoke test covering the headless contract: Open fails
cleanly without a main window, and every entry point is NULL-safe.
- OpenUIWindow now requires IsWindowReady() on both the X11 and SDL
paths: the content texture allocation needs the app's live GL context.
- Document the -DUI_WINDOW_HAVE_SDL opt-in in ui_window.h.
Moved from uncommitted edits in inbe vendor/kryon so the vendored submodule stays pristine (see Projects/AGENTS.md). Work in progress; inbe breaks HUD is the consumer.
OpenUIWindow/CloseUIWindow manage a window beside raylib's core window;
BeginUIWindow/EndUIWindow bracket widget drawing (offscreen texture,
UI frame, pixel blit to the OS window), IsUIWindowClicked polls its
mouse events. Flags: borderless, always-on-top, skip-taskbar, top-right
anchor with margin-based placement against the display work area.
Linux/FreeBSD drive the window through dlopen'd libX11 on a private
Display connection: a second SDL window in this process reproducibly
breaks Mesa llvmpipe (the next frame's scissor batch flush faults after
any glReadPixels), and the private connection also keeps the extra
window's events and blits out of SDL's queue. Borderless windows are
override-redirect, which covers no-decorations/taskbar/stacking for
HUD-style use. Windows/macOS keep the plain SDL surface path;
web/Android are no-ops.
KRYON_UI_WINDOW_DUMP=<path> writes the window's pixels (1 Hz) for
verification. Verified live in inbe: Workrave-style break timer HUD as
a real top-right window with live countdowns.