]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't call gtk_window_set_geometry_hints() if there are no hints to set.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Jun 2012 13:19:30 +0000 (13:19 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Jun 2012 13:19:30 +0000 (13:19 +0000)
Calling gtk_window_set_geometry_hints() with the hints mask of 0 doesn't work
correctly and sets the window size to the smallest possible. Avoid this by
simply not calling this function at all if there is nothing to do.

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

src/gtk/toplevel.cpp

index 0dd59d4b330e95457eae77fe01f71aa86f5d68eb..4462297a798d4f86a45909262ec5781c323868ac 100644 (file)
@@ -1137,8 +1137,12 @@ void wxTopLevelWindowGTK::DoSetSizeHints( int minW, int minH,
         hints.width_inc  = incW > 0 ? incW : 1;
         hints.height_inc = incH > 0 ? incH : 1;
     }
-    gtk_window_set_geometry_hints(
-        (GtkWindow*)m_widget, NULL, &hints, (GdkWindowHints)hints_mask);
+
+    if (hints_mask)
+    {
+        gtk_window_set_geometry_hints(
+            (GtkWindow*)m_widget, NULL, &hints, (GdkWindowHints)hints_mask);
+    }
 }
 
 void wxTopLevelWindowGTK::GTKUpdateDecorSize(const wxSize& decorSize)