]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/toplevel.cpp
Remove unnecessary base class OnPaint() call from wxGenericColourDialog.
[wxWidgets.git] / src / gtk / toplevel.cpp
index b55b5663a887b18814b46d4c73d491ae5cd71865..0dd59d4b330e95457eae77fe01f71aa86f5d68eb 100644 (file)
@@ -246,22 +246,6 @@ size_allocate(GtkWidget*, GtkAllocation* alloc, wxTopLevelWindowGTK* win)
 }
 }
 
-// ----------------------------------------------------------------------------
-// "size_request"
-// ----------------------------------------------------------------------------
-
-extern "C" {
-static
-void wxgtk_tlw_size_request_callback(GtkWidget * WXUNUSED(widget),
-                                     GtkRequisition *requisition,
-                                     wxTopLevelWindowGTK *win)
-{
-    // we must return the size of the window without WM decorations, otherwise
-    // GTK+ gets confused, so don't call just GetSize() here
-    win->GTKDoGetSize(&requisition->width, &requisition->height);
-}
-}
-
 //-----------------------------------------------------------------------------
 // "delete_event"
 //-----------------------------------------------------------------------------
@@ -628,8 +612,6 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
     g_signal_connect(m_wxwindow, "size_allocate",
         G_CALLBACK(size_allocate), this);
 
-    g_signal_connect (m_widget, "size_request",
-                      G_CALLBACK (wxgtk_tlw_size_request_callback), this);
     PostCreation();
 
 #if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
@@ -703,6 +685,15 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
         }
     }
 
+    // GTK sometimes chooses very small size if max size hint is not explicitly set
+    int maxWidth = m_maxWidth;
+    int maxHeight = m_maxHeight;
+    if (maxWidth < 0)
+        maxWidth = INT_MAX;
+    if (maxHeight < 0)
+        maxHeight = INT_MAX;
+    DoSetSizeHints(m_minWidth, m_minHeight, maxWidth, maxHeight, -1, -1);
+
     m_decorSize = GetCachedDecorSize();
     int w, h;
     GTKDoGetSize(&w, &h);
@@ -1442,7 +1433,7 @@ bool wxTopLevelWindowGTK::CanSetTransparent()
 #if GTK_CHECK_VERSION(2,10,0)
     if (!gtk_check_version(2,10,0))
     {
-        return (gtk_widget_is_composited (m_widget));
+        return gtk_widget_is_composited(m_widget) != 0;
     }
     else
 #endif // In case of lower versions than gtk+-2.10.0 we could look for _NET_WM_CM_Sn ourselves