X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0b5c0e1ac19ac7520dea4477c581dd538e1815b6..819451b6c76bdcaf5fd8865479209859511aa986:/src/x11/nanox.c?ds=sidebyside diff --git a/src/x11/nanox.c b/src/x11/nanox.c index c080455ff5..0aafc49442 100644 --- a/src/x11/nanox.c +++ b/src/x11/nanox.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "wx/defs.h" #include "wx/x11/nanox/X11/Xlib.h" @@ -154,6 +155,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; @@ -179,12 +182,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) { @@ -351,6 +367,7 @@ XFontStruct* XLoadQueryFont(Display* display, const char* fontSpec) XFontStruct* fontInfo = malloc(sizeof(XFontStruct)); fontInfo->fid = GrCreateFont(fontName, 0, 0); GrGetFontInfo(fontInfo->fid, & fontInfo->info); + printf("Warning: should not call XLoadQueryFont since font spec is not used in Nano-X.\n"); return fontInfo; }