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);