]> git.sesse.net Git - vlc/commitdiff
skins2: avoid layout resize if size is unchanged
authorErwan Tulou <erwan10@videolan.org>
Wed, 3 Apr 2013 12:30:42 +0000 (14:30 +0200)
committerErwan Tulou <erwan10@videolan.org>
Wed, 3 Apr 2013 12:34:15 +0000 (14:34 +0200)
modules/gui/skins2/src/generic_layout.cpp
modules/gui/skins2/src/window_manager.cpp

index a2e1cd686d6fc3c365b7b9a7a13012f8ab301172..d9464b26887b40b339134d9c9b987aa023209ba0 100644 (file)
@@ -174,6 +174,10 @@ void GenericLayout::onControlUpdate( const CtrlGeneric &rCtrl,
 
 void GenericLayout::resize( int width, int height )
 {
+    // check real resize
+    if( width == m_rect.getWidth() && height == m_rect.getHeight() )
+        return;
+
     // Update the window size
     m_rect = SkinsRect( 0, 0 , width, height );
 
@@ -191,16 +195,6 @@ void GenericLayout::resize( int width, int height )
     {
         iter->m_pControl->onResize();
     }
-
-    // Resize and refresh the associated window
-    TopWindow *pWindow = getWindow();
-    if( pWindow )
-    {
-        // Resize the window
-        pWindow->resize( width, height );
-        // Change the shape of the window and redraw it
-        refreshAll();
-    }
 }
 
 
@@ -236,7 +230,6 @@ void GenericLayout::refreshRect( int x, int y, int width, int height )
     {
         // first apply new shape to the window
         pWindow->updateShape();
-
         pWindow->invalidateRect( x, y, width, height );
     }
 }
index b611e15cfa3e9f34acbb80734d01c843454833df..24f8fd6aeac0d97073cd9bf3688291c7277be998 100644 (file)
@@ -278,6 +278,13 @@ void WindowManager::resize( GenericLayout &rLayout,
     // Do the actual resizing
     rLayout.resize( newWidth, newHeight );
 
+    // Resize the window
+    TopWindow *pWindow = rLayout.getWindow();
+    pWindow->resize( newWidth, newHeight );
+
+    // refresh content
+    rLayout.refreshAll();
+
     // Move all the anchored windows
     WinSet_t::const_iterator it;
     if( m_direction == kResizeE ||