]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/nanox.c
Reversed the meaning of black and white in wxRegion::ConvertToBitmap
[wxWidgets.git] / src / x11 / nanox.c
index ee7dda409889a2a1d5c4727aff6cf9946ee83da1..0aafc49442a6ca02806722b7787af70e9f42613a 100644 (file)
@@ -155,6 +155,8 @@ Status XGetWindowAttributes(Display* display, Window w,
                             XWindowAttributes* window_attributes)
 {
     GR_WINDOW_INFO info;
                             XWindowAttributes* window_attributes)
 {
     GR_WINDOW_INFO info;
+    Window parent = 0;
+    GrFlush();
     GrGetWindowInfo(w, & info);
 
     window_attributes->x = info.x;
     GrGetWindowInfo(w, & info);
 
     window_attributes->x = info.x;
@@ -180,12 +182,25 @@ Status XGetWindowAttributes(Display* display, Window w,
     window_attributes->override_redirect = FALSE;
     window_attributes->screen = NULL;
 
     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;
 
     return 1;
 }
 
 static XErrorHandler* g_ErrorHandler = NULL;
 
-static void DefaultNanoXErrorHandler(GR_EVENT_ERROR* ep)
+void DefaultNanoXErrorHandler(GR_EVENT_ERROR* ep)
 {
     if (g_ErrorHandler)
     {
 {
     if (g_ErrorHandler)
     {