diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 1dd2a8e10..31bd1d85a 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -225,6 +225,19 @@ X11_GetNetWMState(_THIS, Window xwindow) if (fullscreen == 1) { flags |= SDL_WINDOW_FULLSCREEN; } + + /* If the window is unmapped, numItems will be zero and _NET_WM_STATE_HIDDEN + * will not be set. Do an additional check to see if the window is unmapped + * and mark it as SDL_WINDOW_HIDDEN if it is. + */ + { + XWindowAttributes attr; + SDL_memset(&attr,0,sizeof(attr)); + X11_XGetWindowAttributes(videodata->display, xwindow, &attr); + if (attr.map_state == IsUnmapped) { + flags |= SDL_WINDOW_HIDDEN; + } + } X11_XFree(propertyValue); }