]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/app.cpp
Crash fix under VC++
[wxWidgets.git] / src / x11 / app.cpp
index 1c924a182280b08fd8c078c270ea27a6f0364f7b..5d1ab3726cf139c4a01dbc1cccf2f29563718782 100644 (file)
@@ -46,8 +46,8 @@
 
 extern wxList wxPendingDelete;
 
-wxHashTable *wxWidgetHashTable = NULL;
-wxHashTable *wxClientWidgetHashTable = NULL;
+wxWindowHash *wxWidgetHashTable = NULL;
+wxWindowHash *wxClientWidgetHashTable = NULL;
 
 static bool g_showIconic = FALSE;
 static wxSize g_initialSize = wxDefaultSize;
@@ -173,7 +173,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
         xdisplay = XOpenDisplay( displayName.ToAscii() );
     if (!xdisplay)
     {
-        wxLogError( _("wxWindows could not open display. Exiting.") );
+        wxLogError( _("wxWidgets could not open display. Exiting.") );
         return false;
     }
 
@@ -203,8 +203,8 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
     wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding());
 #endif
 
-    wxWidgetHashTable = new wxHashTable(wxKEY_INTEGER);
-    wxClientWidgetHashTable = new wxHashTable(wxKEY_INTEGER);
+    wxWidgetHashTable = new wxWindowHash;
+    wxClientWidgetHashTable = new wxWindowHash;
 
     return true;
 }
@@ -446,16 +446,15 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
             if (event->update.utype == GR_UPDATE_SIZE)
 #endif
             {
-                if (win->IsTopLevel())
+                wxTopLevelWindow *tlw = wxDynamicCast(win, wxTopLevelWindow);
+                if ( tlw )
                 {
-                    wxTopLevelWindow *tlw = (wxTopLevelWindow*) win;
                     tlw->SetConfigureGeometry( XConfigureEventGetX(event), XConfigureEventGetY(event),
                         XConfigureEventGetWidth(event), XConfigureEventGetHeight(event) );
                 }
 
-                if (win->IsTopLevel() && win->IsShown())
+                if ( tlw && tlw->IsShown() )
                 {
-                    wxTopLevelWindowX11 *tlw = (wxTopLevelWindowX11 *) win;
                     tlw->SetNeedResizeInIdle();
                 }
                 else
@@ -467,7 +466,6 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
                 }
             }
             return FALSE;
-            break;
         }
 #if !wxUSE_NANOX
         case PropertyNotify:
@@ -746,7 +744,9 @@ Window wxGetWindowParent(Window window)
 
     return (Window) 0;
 
-    Window parent, root = 0;
+#ifndef __VMS
+   // VMS chokes on unreacheable code
+   Window parent, root = 0;
 #if wxUSE_NANOX
     int noChildren = 0;
 #else
@@ -767,6 +767,7 @@ Window wxGetWindowParent(Window window)
         return parent;
     else
         return (Window) 0;
+#endif
 }
 
 void wxApp::Exit()