X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/16d865f756b8bc251467139b3b75752219ab97bd..d7f1759ac12007c85f5e63b66901cde202bf79dc:/src/x11/nanox.c diff --git a/src/x11/nanox.c b/src/x11/nanox.c index ee7dda4098..5da90dd64d 100644 --- a/src/x11/nanox.c +++ b/src/x11/nanox.c @@ -2,6 +2,7 @@ * nanox.c * * Replacements for some comomon Xlib functions + * Licence: The wxWindows licence */ #include "wx/setup.h" @@ -155,6 +156,8 @@ Status XGetWindowAttributes(Display* display, Window w, XWindowAttributes* window_attributes) { GR_WINDOW_INFO info; + Window parent = 0; + GrFlush(); GrGetWindowInfo(w, & info); window_attributes->x = info.x; @@ -180,12 +183,25 @@ Status XGetWindowAttributes(Display* display, Window w, window_attributes->override_redirect = FALSE; window_attributes->screen = NULL; + /* We need to check if any parents are unmapped, + * or we will report a window as mapped when it is not. + */ + parent = info.parent; + while (parent) + { + GrGetWindowInfo(parent, & info); + if (info.mapped == 0) + window_attributes->map_state = IsUnmapped; + + parent = info.parent; + } + return 1; } static XErrorHandler* g_ErrorHandler = NULL; -static void DefaultNanoXErrorHandler(GR_EVENT_ERROR* ep) +void DefaultNanoXErrorHandler(GR_EVENT_ERROR* ep) { if (g_ErrorHandler) {