diff --git a/src/wmspec.c b/src/wmspec.c index 2cb5e38..47fc176 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -362,6 +362,8 @@ void wNETWMUpdateDesktop(WScreen *scr) long *views, sizes[2]; int count, i; + if (!dpy) return; /* Wayland: no X11 root-window properties */ + if (scr->workspace_count == 0) return; @@ -389,6 +391,8 @@ int wNETWMGetCurrentDesktopFromHint(WScreen *scr) int count; unsigned char *prop; + if (!dpy) return -1; /* Wayland: no X11 _NET_CURRENT_DESKTOP hint */ + prop = PropGetCheckProperty(scr->root_win, net_current_desktop, WA_CARDINAL, 0, 1, &count); if (prop) { int desktop = *(long *)prop; @@ -576,6 +580,8 @@ static void updateWindowOpacity(WWindow *wwin) unsigned long items, rest; unsigned long *property; + if (!dpy) return; /* Wayland: no X11 _NET_WM_WINDOW_OPACITY */ + if (!wwin->frame) return; @@ -651,6 +657,8 @@ void wNETWMInitStuff(WScreen *scr) NetData *data; int i; + if (!dpy) return; /* Wayland: no X11 NETWM atoms or root-window hints */ + #ifdef DEBUG_WMSPEC wmessage("wNETWMInitStuff"); #endif @@ -708,6 +716,8 @@ void wNETWMCleanup(WScreen *scr) { int i; + if (!dpy) return; /* Wayland: no X11 root-window atoms to clean up */ + for (i = 0; i < wlengthof(atomNames); i++) XDeleteProperty(dpy, scr->root_win, *atomNames[i].atom); } @@ -717,6 +727,8 @@ void wNETWMUpdateActions(WWindow *wwin, Bool del) Atom action[10]; /* nr of actions atoms defined */ int i = 0; + if (!dpy) return; /* Wayland: no X11 _NET_WM_ALLOWED_ACTIONS property */ + if (del) { XDeleteProperty(dpy, wwin->client_win, net_wm_allowed_actions); return;