]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
add aglUpdateContext() call (doesn't seem to change anything but should be there...
[wxWidgets.git] / src / gtk / window.cpp
index 731161383936942929852d8835e025bfde42ba15..75a8c2df4464058a8e53c7732ecdfe0c1a3f45f5 100644 (file)
@@ -1880,12 +1880,14 @@ gtk_window_focus_out_callback( GtkWidget *widget,
     }
 #endif // wxUSE_CARET
 
-    gboolean ret = FALSE;
-
     // don't send the window a kill focus event if it thinks that it doesn't
     // have focus already
     if ( win->m_hasFocus )
     {
+        // the event handler might delete the window when it loses focus, so
+        // check whether this is a custom window before calling it
+        const bool has_wxwindow = win->m_wxwindow != NULL;
+
         win->m_hasFocus = false;
 
         wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
@@ -1893,14 +1895,13 @@ gtk_window_focus_out_callback( GtkWidget *widget,
 
         (void)win->GTKProcessEvent( event );
 
-        ret = TRUE;
+        // Disable default focus handling for custom windows
+        // since the default GTK+ handler issues a repaint
+        if ( has_wxwindow )
+            return TRUE;
     }
 
-    // Disable default focus handling for custom windows
-    // since the default GTK+ handler issues a repaint
-    if (win->m_wxwindow)
-        return ret;
-
+    // continue with normal processing
     return FALSE;
 }
 
@@ -2323,21 +2324,31 @@ bool wxWindowGTK::Create( wxWindow *parent,
 
     m_insertCallback = wxInsertChildInWindow;
 
-    m_wxwindow = gtk_pizza_new();
+
+    if (!HasFlag(wxHSCROLL) && !HasFlag(wxVSCROLL))
+    {
+        m_wxwindow = gtk_pizza_new_no_scroll();
 
 #ifndef __WXUNIVERSAL__
-    if (HasFlag(wxSIMPLE_BORDER))
-        gtk_container_set_border_width((GtkContainer*)m_wxwindow, 1);
-    else if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER))
-        gtk_container_set_border_width((GtkContainer*)m_wxwindow, 2);
+        if (HasFlag(wxSIMPLE_BORDER))
+            gtk_container_set_border_width((GtkContainer*)m_wxwindow, 1);
+        else if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER))
+            gtk_container_set_border_width((GtkContainer*)m_wxwindow, 2);
 #endif // __WXUNIVERSAL__
 
-    if (!HasFlag(wxHSCROLL) && !HasFlag(wxVSCROLL))
-    {
         m_widget = m_wxwindow;
     }
     else
     {
+        m_wxwindow = gtk_pizza_new();
+
+#ifndef __WXUNIVERSAL__
+        if (HasFlag(wxSIMPLE_BORDER))
+            gtk_container_set_border_width((GtkContainer*)m_wxwindow, 1);
+        else if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER))
+            gtk_container_set_border_width((GtkContainer*)m_wxwindow, 2);
+#endif // __WXUNIVERSAL__
+
         m_widget = gtk_scrolled_window_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
 
         GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);