]> git.saurik.com Git - wxWidgets.git/commitdiff
revert updating GTK size hints when window decorations change, it messes up min size...
authorPaul Cornett <paulcor@bullseye.com>
Thu, 28 Feb 2008 06:34:43 +0000 (06:34 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Thu, 28 Feb 2008 06:34:43 +0000 (06:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/toplevel.h
src/gtk/toplevel.cpp

index a8bc266b57a30af5366d7b7ad859ed3916348c79..2fa607c415b913186afb491b84bfefd69c99ed10 100644 (file)
@@ -145,8 +145,6 @@ private:
 
     // is the frame currently grabbed explicitly by the application?
     bool m_grabbed;
-
-    wxSize m_sizeIncHint;
 };
 
 #endif // _WX_GTK_TOPLEVEL_H_
index 35197bcd419b5623dcce60129429d297a7461b29..158ff231327daf993a0e865a05732142e2786696 100644 (file)
@@ -939,8 +939,6 @@ void wxTopLevelWindowGTK::DoSetSizeHints( int minW, int minH,
                                           int incW, int incH )
 {
     wxTopLevelWindowBase::DoSetSizeHints( minW, minH, maxW, maxH, incW, incH );
-    m_sizeIncHint.x = incW;
-    m_sizeIncHint.y = incH;
 
     const wxSize minSize = GetMinSize();
     const wxSize maxSize = GetMaxSize();
@@ -982,23 +980,32 @@ void wxTopLevelWindowGTK::GTKUpdateDecorSize(const wxSize& decorSize)
     {
         const wxSize diff = decorSize - m_decorSize;
         m_decorSize = decorSize;
-        SetSizeHints(GetMinSize(), GetMaxSize(), m_sizeIncHint);
+        bool resized = false;
         if (m_deferShow)
         {
             // keep overall size unchanged by shrinking m_widget
             int w, h;
             GTKDoGetSize(&w, &h);
-            gtk_window_resize(GTK_WINDOW(m_widget), w, h);
+            // but not if size would be less than minimum, it won't take effect
+            const wxSize minSize = GetMinSize();
+            if (w >= minSize.x && h >= minSize.y)
+            {
+                gtk_window_resize(GTK_WINDOW(m_widget), w, h);
+                resized = true;
+            }
         }
-        else
+        if (!resized)
         {
             // adjust overall size to match change in frame extents
             m_width  += diff.x;
             m_height += diff.y;
             if (m_width  < 0) m_width  = 0;
             if (m_height < 0) m_height = 0;
-            m_oldClientWidth = 0;
-            gtk_widget_queue_resize(m_wxwindow);
+            if (!m_deferShow)
+            {
+                m_oldClientWidth = 0;
+                gtk_widget_queue_resize(m_wxwindow);
+            }
         }
     }
     if (m_deferShow)