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.
This commit is contained in:
Window Maker 2026-05-24 15:31:41 +02:00
parent 7a422330f6
commit bc431e5727
1 changed files with 6 additions and 4 deletions

View File

@ -31,6 +31,8 @@
#include "WINGsP.h"
#include <wraster.h>
#include <wayland-client.h>
#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;