[client] x11: check if the EWMH atoms exist before using them

This commit is contained in:
Geoffrey McRae 2022-02-10 13:35:19 +11:00
parent e96311eb7b
commit cfd2e6ff32

View File

@ -195,6 +195,10 @@ static void x11CheckEWMHSupport(void)
Window * windowFromRoot = (Window *)data; Window * windowFromRoot = (Window *)data;
if (!x11atoms._NET_SUPPORTING_WM_CHECK || !x11atoms._NET_SUPPORTED ||
!x11atoms._NET_WM_NAME)
goto out_root;
if (XGetWindowProperty(x11.display, *windowFromRoot, if (XGetWindowProperty(x11.display, *windowFromRoot,
x11atoms._NET_SUPPORTING_WM_CHECK, 0, ~0L, False, XA_WINDOW, x11atoms._NET_SUPPORTING_WM_CHECK, 0, ~0L, False, XA_WINDOW,
&type, &fmt, &num, &bytes, &data) != Success) &type, &fmt, &num, &bytes, &data) != Success)