sfx2/source/appl/workwin.cxx |   23 ++++++++++++++++++++++-
 sfx2/source/inc/workwin.hxx  |    2 ++
 2 files changed, 24 insertions(+), 1 deletion(-)

New commits:
commit 32a38bae39661a4c0f08e5e2a9db8c4f1fda462a
Author: Caolán McNamara <caol...@redhat.com>
Date:   Fri Apr 13 10:10:29 2018 +0100

    Resolves: tdf#116865 trigger pending sizing timers before arranging
    
    trigger pending sizing timers now so we arrange with the final size of the
    client area
    
    Otherwise calling GetSizePixel in the Arranging loop will trigger the timers
    anyway, causing reentry into Arrange_Impl again where the inner Arrange_Impl
    arranges with the final size, and then returns to this outer Arrange_Impl 
which
    would rearrange with the old client area size.
    
    Change-Id: Ibc2b97f679ceaa0a825cee015576f403703a5f9e
    Reviewed-on: https://gerrit.libreoffice.org/52816
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 8d0970ed5d81..3a09ab31aa5a 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -696,6 +696,20 @@ void SfxWorkWindow::ArrangeChildren_Impl( bool bForce )
     ArrangeAutoHideWindows( nullptr );
 }
 
+void SfxWorkWindow::FlushPendingChildSizes()
+{
+    // tdf#116865, if any windows are being resized, i.e. their
+    // resize timer is active, then calling GetSizePixel on
+    // them forces the timer to fire and sets the final
+    // size to which they are getting resized towards.
+    for (size_t i = 0; i < aChildren.size(); ++i)
+    {
+        SfxChild_Impl *pCli = aChildren[i];
+        if (!pCli || !pCli->pWin)
+            continue;
+        (void)pCli->pWin->GetSizePixel();
+    }
+}
 
 SvBorder SfxWorkWindow::Arrange_Impl()
 
@@ -707,7 +721,14 @@ SvBorder SfxWorkWindow::Arrange_Impl()
     ClientArea, it is set to "not visible".
 */
 {
-
+    //tdf#116865 trigger pending sizing timers now so we arrange
+    //with the final size of the client area.
+    //
+    //Otherwise calling GetSizePixel in the following loop will trigger the
+    //timers, causing reentry into Arrange_Impl again where the inner
+    //Arrange_Impl arranges with the final size, and then returns to this outer
+    //Arrange_Impl which would rearrange with the old client area size
+    FlushPendingChildSizes();
     aClientArea = GetTopRect_Impl();
     aUpperClientArea = aClientArea;
 
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
index 6a80892900eb..0c714c479446 100644
--- a/sfx2/source/inc/workwin.hxx
+++ b/sfx2/source/inc/workwin.hxx
@@ -226,6 +226,8 @@ class SfxWorkWindow final
     void                    SaveStatus_Impl(SfxChildWindow*, const 
SfxChildWinInfo&);
     static bool             IsPluginMode( SfxObjectShell const * pObjShell );
 
+    void                    FlushPendingChildSizes();
+
 public:
                             SfxWorkWindow( vcl::Window* pWin, SfxFrame* pFrm, 
SfxFrame* pMaster );
                             ~SfxWorkWindow();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to