]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/app.cpp
ROP changes.
[wxWidgets.git] / src / gtk1 / app.cpp
index 98327a2aee941a3c958e9ad2fb31147e92ccf649..fce981832b01e007c4aaabcf48889d4bebce3bdc 100644 (file)
@@ -250,6 +250,8 @@ wxApp::wxApp()
 #endif
 
     m_colorCube = (unsigned char*) NULL;
+    
+    m_useBestVisual = FALSE;
 }
 
 wxApp::~wxApp()
@@ -271,7 +273,8 @@ bool wxApp::OnInitGui()
        we make sure we get the best. this can sometimes be wasteful,
        of course, but what do these guys pay $30.000 for? */
        
-    if (gdk_visual_get_best() != gdk_visual_get_system())
+    if ((gdk_visual_get_best() != gdk_visual_get_system()) &&
+        (m_useBestVisual))
     {
         GdkVisual* vis = gdk_visual_get_best();
         gtk_widget_set_default_visual( vis );
@@ -282,9 +285,6 @@ bool wxApp::OnInitGui()
         visual = vis;
     }
 
-    wxRootWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL );
-    gtk_widget_realize( wxRootWindow );
-
     /* Nothing to do for 15, 16, 24, 32 bit displays */
     if (visual->depth > 8) return TRUE;
 
@@ -632,6 +632,9 @@ int wxEntry( int argc, char *argv[] )
     if ( !wxTheApp->OnInitGui() )
         retValue = -1;
 
+    wxRootWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+    gtk_widget_realize( wxRootWindow );
+
     // Here frames insert themselves automatically into wxTopLevelWindows by
     // getting created in OnInit().
     if ( retValue == 0 )