From c7aa9f7578e721b0c9e565e7a085b6aeb30bf2ac Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 4 Feb 2012 17:04:11 +0000 Subject: [PATCH] hw/xwin: _NET_WM_STATE is ATOM[] not ATOM _NET_WM_STATE is ATOM[] not ATOM, a list of window state hints, so check all of the atoms, not just the first one See EWMH specifcation, section "Application Window Properties" v2: Actually use [] on the returned atom data Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winmultiwindowwm.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 4f6dec78b..7671bda4f 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1626,23 +1626,27 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) } if (XGetWindowProperty(pDisplay, iWindow, windowState, 0L, - 1L, False, XA_ATOM, &type, &format, + MAXINT, False, XA_ATOM, &type, &format, &nitems, &left, (unsigned char **) &pAtom) == Success) { - if (pAtom && nitems == 1) { - if (*pAtom == skiptaskbarState) - hint |= HINT_SKIPTASKBAR; - if (*pAtom == hiddenState) - maxmin |= HINT_MIN; - else if (*pAtom == fullscreenState) - maxmin |= HINT_MAX; - if (*pAtom == belowState) - *zstyle = HWND_BOTTOM; - else if (*pAtom == aboveState) - *zstyle = HWND_TOPMOST; - } - if (pAtom) + if (pAtom ) { + unsigned long i; + + for (i = 0; i < nitems; i++) { + if (pAtom[i] == skiptaskbarState) + hint |= HINT_SKIPTASKBAR; + if (pAtom[i] == hiddenState) + maxmin |= HINT_MIN; + else if (pAtom[i] == fullscreenState) + maxmin |= HINT_MAX; + if (pAtom[i] == belowState) + *zstyle = HWND_BOTTOM; + else if (pAtom[i] == aboveState) + *zstyle = HWND_TOPMOST; + } + XFree(pAtom); + } } nitems = left = 0;