From bc431e57270da1d26ad7c73f0a3cab955368e12b Mon Sep 17 00:00:00 2001 From: Window Maker Date: Sun, 24 May 2026 15:31:41 +0200 Subject: [PATCH] WINGs/wclient_wl: create RContext before WMCreateScreenWithRContext wlclient_open passed NULL as the RContext, causing a segfault in RConvertImageMask (called from makePixmap during screen init) when WPrefs.app launched under Wayland. Fix: call RCreateContextWayland() to create a valid 32-bit ARGB context before passing it to WMCreateScreenWithRContext. --- WINGs/wclient_wl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/WINGs/wclient_wl.c b/WINGs/wclient_wl.c index e3a74f4..18a66be 100644 --- a/WINGs/wclient_wl.c +++ b/WINGs/wclient_wl.c @@ -31,6 +31,8 @@ #include "WINGsP.h" +#include + #include #include "xdg-shell-client-protocol.h" @@ -1032,13 +1034,13 @@ W_WLClientShutdown(struct W_Screen *scrPtr) */ static WMScreen *wlclient_open(const char *display) { - /* Tell WMCreateScreenWithRContext to install the Wayland WINGs - * backends (font/event/render/view/color all -> _WL variants). */ + RContext *rc = RCreateContextWayland(1, 1, NULL); + if (!rc) return NULL; + W_SetNextScreenKind(WM_SCREEN_KIND_WAYLAND); - WMScreen *scr = WMCreateScreenWithRContext(NULL, 0, NULL); + WMScreen *scr = WMCreateScreenWithRContext(NULL, 0, rc); if (!scr) return NULL; if (!W_WLClientInit(scr, display)) { - /* TODO: WMCloseScreen(scr) — currently leaks the failed screen. */ return NULL; } scr->aflags.hasAppIcon = 0;