wayland: Phase 49 — guard PropSet/PropCleanUp against NULL dpy
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 <noreply@anthropic.com>
This commit is contained in:
parent
b0728c7048
commit
0ca749896a
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue