Commit Graph

3 Commits

Author SHA1 Message Date
Levi Neely 685eb42ecc wrlib: split RConvertImage into X11/Wayland backends
RConvertImage and RConvertImageMask now dispatch through function
pointers on RContext, set during context creation:
- RCreateContext sets x11_convert_image/x11_convert_image_mask
- RCreateContextWayland sets wl_convert_image/wl_convert_image_mask

The Wayland backend creates pixman_image_t from RImage RGBA data
instead of returning NULL pixmaps, fixing the SIGSEGV in the exit
dialog when compositing the application icon.

X11 code moved to convert_x11.c, Wayland code in convert_wl.c.
No dpy guards in the middle layer.
2026-05-14 16:41:15 +02:00
Levi Neely b4484e05bc Fix Wayland startup: compositor window appears and event loop runs
Three root causes fixed:

1. RCreateContext crash: wScreenInit called RCreateContext(dpy=NULL).
   Fix: add RCreateContextWayland() to wrlib — creates a minimal 32-bit
   ARGB context without X11. Wayland path in screen.c now always taken
   when is_wayland (removed incorrect XWayland fallthrough).

2. Color parsing: parse_color and get_color_for_colormap were no-ops.
   Fix: implement real color parser in wl_backend supporting #RGB,
   #RRGGBB, #RRRRGGGGBBBB, rgb:RR/GG/BB, and common named colors.
   Texture creation (solid, gradient) now works in Wayland mode.

3. RConvertImage crash: wrlib tried XCreateImage with NULL display.
   Fix: RConvertImage/RConvertImageMask return success with pixmap=0
   when context->dpy is NULL. Callers don't use pixmaps in Wayland
   mode (rendering goes through vtable slots to pixman buffers).

4. Workspace crash: Wayland path skipped wWorkspaceNew(), so
   workspace_count=0 when menu tried to access workspace entries.
   Fix: add wWorkspaceNew + netwm_init to Wayland screen init path.

Result: compositor starts, event loop runs, window is visible.
WMAKER_USE_WAYLAND=1 wmaker now shows a compositor window.
2026-05-13 13:51:27 +02:00
Levi Neely fcee811b99 WindowMaker 0.96.0 upstream source 2026-03-26 15:38:49 +01:00