]> git.saurik.com Git - wxWidgets.git/commitdiff
rearrange some code in DoSetSize to facilitate upcoming changes
authorPaul Cornett <paulcor@bullseye.com>
Thu, 19 Apr 2012 16:44:59 +0000 (16:44 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Thu, 19 Apr 2012 16:44:59 +0000 (16:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71236 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp

index 7ff47a7941ce266132d5431011d30c2eced13757..87477cec2d4f448c3eef45861588d9d2912cc51e 100644 (file)
@@ -2624,17 +2624,22 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
             height = sizeBest.y;
     }
 
-    const wxSize oldSize(m_width, m_height);
-    if (width != -1)
-        m_width = width;
-    if (height != -1)
-        m_height = height;
+    if (width == -1)
+        width = m_width;
+    if (height == -1)
+        height = m_height;
 
-    if (m_parent->m_wxwindow)
+    const bool sizeChange = m_width != width || m_height != height;
+    if (sizeChange || m_x != x || m_y != y)
     {
         m_x = x;
         m_y = y;
+        m_width = width;
+        m_height = height;
+    }
 
+    if (m_parent->m_wxwindow)
+    {
         int left_border = 0;
         int right_border = 0;
         int top_border = 0;
@@ -2661,21 +2666,15 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
                       m_height+top_border+bottom_border );
     }
 
-    if (m_width != oldSize.x || m_height != oldSize.y)
+    if (sizeChange)
     {
         // update these variables to keep size_allocate handler
         // from sending another size event for this change
         GetClientSize( &m_oldClientWidth, &m_oldClientHeight );
 
         gtk_widget_queue_resize(m_widget);
-        if (!m_nativeSizeEvent)
-        {
-            wxSizeEvent event( wxSize(m_width,m_height), GetId() );
-            event.SetEventObject( this );
-            HandleWindowEvent( event );
-        }
-    } else
-    if (sizeFlags & wxSIZE_FORCE_EVENT)
+    }
+    if ((sizeChange && !m_nativeSizeEvent) || (sizeFlags & wxSIZE_FORCE_EVENT))
     {
         wxSizeEvent event( wxSize(m_width,m_height), GetId() );
         event.SetEventObject( this );