Add three display-lifecycle slots to WMBackend:
display_open(name) — open/init display connection, return Display*
(NULL for Wayland; compositor init side-effect)
display_close() — tear down display connection
display_screen_count() — number of logical screens
x11_backend: implement with XOpenDisplay (including close-on-exec fcntl),
XCloseDisplay, ScreenCount(dpy); remove fcntl/FD_CLOEXEC from main.c.
wl_backend: implement display_open() with full wlroots headless compositor
init — wl_display_create, wlr_headless_backend_create, wlr_renderer_autocreate,
wlr_backend_start. display_close() tears down in reverse order.
Compositor state held in a file-static struct. Adds -DWLR_USE_UNSTABLE
to WLROOTS_CFLAGS in configure.ac.
main.c: move backend selection before display_open() (was in StartUp()),
call wm_backend->display_open() instead of XOpenDisplay(); guard all
X11-specific post-open code (visual-id, DisplayName, wXModifierInitialize)
in if(dpy != NULL).
startup.c: replace ScreenCount(dpy) with wm_backend->display_screen_count();
remove now-redundant backend-selection block (owned by main.c).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- startup.c: include wl_backend.h when USE_WAYLAND_BACKEND is defined;
select wl_backend when WMAKER_USE_WAYLAND env var is set, otherwise
fall back to x11_backend (no-op for non-Wayland builds)
- tests/smoke-test.sh renamed to tests/x11-smoke-test.sh (X11-only path)
- tests/wl-smoke-test.sh: new Wayland smoke test; currently verifies
wl_backend symbol presence and wlroots linkage; headless compositor
tests will be added as vtable slots are implemented
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add --enable-wayland-backend configure option (default: auto).
Requires wlroots >= 0.15, wayland-server, xkbcommon via pkg-config.
Detected at build time on this system: wlroots 0.15.1.
New files:
src/backend/wayland/wl_backend.h — declares extern const WMBackend wl_backend
src/backend/wayland/wl_backend.c — complete stub vtable (108 slots)
All stubs return safe zero/null/false values. Every slot matches the
exact WMBackend function-pointer signature; zero compiler warnings.
Build system compiles the Wayland backend files conditionally when
USE_WAYLAND_BACKEND is set; WLROOTS_CFLAGS/LIBS wired into AM_CFLAGS
and wmaker_LDADD.
Subsequent phases will replace stubs with real wlroots implementations.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>