Commit Graph

3 Commits

Author SHA1 Message Date
Levi Neely 2d9b9b76c5 wayland: migrate wlroots 0.16 API to 0.19 + animation overlay system
Port from wlroots ~0.16 to 0.19 (Gentoo slotted packages) and add the
Phase 81 XOR animation overlay.  Fixes Gentoo build from scratch.

configure.ac: detect wlroots-0.19 versioned slot before falling back to
unversioned; fixes "Package wlroots was not found" on Gentoo.

startup.c: add missing <X11/Xresource.h> for XrmUniqueQuark on Gentoo's
stricter X11 headers.

wl_backend.c — wlroots 0.16→0.19 API migration:
- Backend creation: display* → wl_event_loop* (get_event_loop)
- wlr_output_layout_create gains display* arg
- Output configuration: wlr_output_enable/commit/set_mode → wlr_output_state API
- wlr_output_layout_get_box: returns void, writes to caller-supplied box
- Scene graph: scene root is scene->tree (wlr_scene_tree*); create
  functions return/accept wlr_scene_tree*; scene_node.state.x/y → .x/.y
- wlr_scene_output_commit gains options arg (NULL)
- Protocol globals gain version args: compositor(6), xdg_shell(3),
  layer_shell(4), linux_dmabuf_with_renderer(4), presentation(1)
- Input: dev->keyboard/pointer embedded fields removed; use
  wlr_keyboard/pointer_from_input_device(); headless backend no longer
  has input devices; XKB keymap created independently at startup
- Keyboard: wlr_event_keyboard_key → wlr_keyboard_key_event;
  wlr_seat_set_keyboard takes wlr_keyboard* directly
- Pointer: all wlr_event_pointer_* → wlr_pointer_*_event;
  wlr_seat_pointer_notify_axis gains relative_direction arg;
  wlr_cursor_warp_absolute uses &ev->pointer->base
- Cursor: wlr_xcursor_manager_set_cursor_image → wlr_cursor_set_xcursor
- XDG shell: xdg_surface->events.map/unmap → surface->events.map/unmap;
  xdg_surface->mapped → surface->mapped; toplevel_set_size/send_close/
  parent take wlr_xdg_toplevel*
- XWayland: events.map/unmap → events.associate/dissociate;
  xw->mapped → xw->surface->mapped; size_hints is xcb_size_hints_t*
- Layer shell: ls->events.map/unmap → ls->surface->events.map/unmap
- wlr_buffer: include wlr/interfaces/wlr_buffer.h for wlr_buffer_init
- Remove wlr_input_inhibitor and wlr_idle (dropped in wlroots 0.18)

wl_backend.c — Phase 81 XOR animation overlay:
- Full-screen pixman SHM overlay surface for move/resize rubber-band
  guides and miniaturize animations
- Embedded 5×9 bitmap font (96 printable ASCII glyphs)
- Bresenham line drawing; hline/vline fast paths
- overlay_ensure: lazy alloc/resize tied to WScreen dimensions
- server_ungrab flushes overlay to scene graph

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 18:51:05 +02:00
Levi Neely a486329b52 Wayland backend abstraction: WMBackend vtable (Phases 0–30)
Introduce a display-system-agnostic WMBackend vtable that routes all
display operations through function pointers, making the WM policy
layer independent of X11.  The X11 implementation is preserved in
src/backend/x11/ and behaviour is unchanged.

Key structural changes
──────────────────────
• src/backend/backend_types.h — backend-neutral type definitions:
    WNativeWindow, WKeyCode, WContextKey, WBackendScreen,
    WBackendEvent (+typed fields), WNormalHints, WWMHints,
    WNETWindowType, WHeadGeometry, WClientAttributes, WClientVisual,
    WSegment, WPoint, WM_KEY_* keysym constants, WA_* atom IDs,
    WKB_GROUP*_INDEX, WCUR_NONE

• src/backend/backend.h — WMBackend vtable (~100 function-pointer
    slots) covering: frame/context lifecycle, stacking, focus, grabs,
    pointer, keyboard, overlays, properties, ICCCM, EWMH/NETWM,
    monitors, screen setup, cursors, extensions, error handlers.
    No <X11/> headers remain in this file after Phase 30.

• src/backend/x11/ — X11 backend implementation:
    x11_backend.c  full vtable; all display calls confined here
    x11_props.c    WM_NORMAL_HINTS / WM_HINTS translation
    x11_event.c    XEvent → WBackendEvent translation
    x11_monitor.c  Xinerama / RandR monitor query

Policy files cleaned
────────────────────
All 47 files in WM_POLICY_CLEAN_FILES pass check-no-x11-policy
(no direct #include <X11/> anywhere).  X11 types that still appear
in policy structs (Visual*, Colormap, Window, Atom …) arrive only
transitively via WINGs.h; the vtable boundary itself is X11-free.

Tests
─────
• tests/smoke-test.sh — full Xvfb lifecycle test (PASS)
• tests/test_geom.c   — geometry / constraint unit tests
• tests/test_x11_event.c — WBackendEvent field extraction tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 19:20:00 +01:00
Levi Neely fcee811b99 WindowMaker 0.96.0 upstream source 2026-03-26 15:38:49 +01:00