]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed XGetWindowAttributes so 'mapped' is reported
authorJulian Smart <julian@anthemion.co.uk>
Tue, 26 Feb 2002 14:51:08 +0000 (14:51 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 26 Feb 2002 14:51:08 +0000 (14:51 +0000)
correctly. About box now pops up, but is a mess.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/x11/app.cpp
src/x11/nanox.c
src/x11/window.cpp

index 83dbe1346626db2340a3c23be0d96b25a35aecc0..fe76481c957503b7f0b7988ba97a18023279c466 100644 (file)
@@ -180,8 +180,10 @@ void wxApp::CleanUp()
 int wxEntryStart( int& argc, char *argv[] )
 {
 #ifdef __WXDEBUG__
+#if !wxUSE_NANOX
     // install the X error handler
     gs_pfnXErrorHandler = XSetErrorHandler( wxXErrorHandler );
+#endif
 #endif // __WXDEBUG__
 
     wxString displayName;
index ee7dda409889a2a1d5c4727aff6cf9946ee83da1..0aafc49442a6ca02806722b7787af70e9f42613a 100644 (file)
@@ -155,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;
@@ -180,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)
     {
index 8159498ff70d6d3f7b57653e489605486ddd1cb7..a83a67877cfed6d59a209b3a5cd59d3ef6307401 100644 (file)
@@ -1062,7 +1062,9 @@ void wxWindowX11::OnInternalIdle()
 
     // Set the input focus if couldn't do it before
     if (m_needsInputFocus)
+    {
        SetFocus();
+    }
 }
 
 // ----------------------------------------------------------------------------