From 0ca749896a876ec0c121a1e296942413f75cb719 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 28 Mar 2026 06:55:50 +0100 Subject: [PATCH] =?UTF-8?q?wayland:=20Phase=2049=20=E2=80=94=20guard=20Pro?= =?UTF-8?q?pSet/PropCleanUp=20against=20NULL=20dpy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add if (!dpy) return guards to PropSetWMakerProtocols, PropSetIconTileHint, and PropCleanUp so the Wayland path does not call XChangeProperty/XInternAtom/XDeleteProperty on a NULL display during screen setup and shutdown. Co-Authored-By: Claude Sonnet 4.6 --- src/properties.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/properties.c b/src/properties.c index 0826f06..82bb874 100644 --- a/src/properties.c +++ b/src/properties.c @@ -41,6 +41,8 @@ void PropGetProtocols(Window window, WProtocols * prots) int count, i; memset(prots, 0, sizeof(WProtocols)); + if (!dpy) + return; /* Wayland: no ICCCM WM_PROTOCOLS */ if (!XGetWMProtocols(dpy, window, &protocols, &count)) { return; } @@ -60,6 +62,9 @@ void PropGetProtocols(Window window, WProtocols * prots) unsigned char *PropGetCheckProperty(Window window, Atom hint, Atom type, int format, int count, int *retCount) { Atom type_ret; + + if (!dpy) + return NULL; /* Wayland: no X11 property store */ int fmt_ret; unsigned long nitems_ret; unsigned long bytes_after_ret; @@ -95,6 +100,8 @@ void PropSetWMakerProtocols(Window root) Atom protocols[3]; int count = 0; + if (!dpy) return; /* Wayland: no X11 root-window WMaker protocols */ + protocols[count++] = w_global.atom.wmaker.menu; protocols[count++] = w_global.atom.wmaker.wm_function; protocols[count++] = w_global.atom.wmaker.noticeboard; @@ -109,6 +116,8 @@ void PropSetIconTileHint(WScreen * scr, RImage * image) unsigned char *tmp; int x, y; + if (!dpy) return; /* Wayland: no X11 icon tile hint */ + if (scr->info_window == None) return; @@ -188,6 +197,8 @@ int PropGetWindowState(Window window) void PropCleanUp(Window root) { + if (!dpy) return; /* Wayland: no X11 root-window atoms to clean up */ + XDeleteProperty(dpy, root, w_global.atom.wmaker.wm_protocols); XDeleteProperty(dpy, root, w_global.atom.wmaker.noticeboard); XDeleteProperty(dpy, root, WA_WM_ICON_SIZE);