[Libreoffice-commits] core.git: vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Aug 27 06:13:56 UTC 2018


 vcl/source/window/dockmgr.cxx |   36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)

New commits:
commit afd49c198769b5e7fc01a68ce7a6847aa0d0ddd8
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sat Aug 25 02:35:26 2018 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Mon Aug 27 08:13:35 2018 +0200

    tdf#90376 revert the dock windows' Idles to Timers
    
    The dock windows' Timers were converted to Idles in commit
    eef25e0e7c03 ("changed timers to idles"). Since the Idles poll
    the mouse buttons, they starve all lower priority events.
    
    From the comment in ImplDockFloatWin2::Move, this is a hack to
    get the mouse release event from the window decorations in X11.
    
    Change-Id: Ibba3c58dd8b3d95dbd9296cc111ab32968bee230
    Reviewed-on: https://gerrit.libreoffice.org/59590
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 00d49f21a8a2..54465d6ec316 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -43,8 +43,8 @@ class ImplDockFloatWin2 : public FloatingWindow
 private:
     ImplDockingWindowWrapper*  mpDockWin;
     sal_uInt64      mnLastTicks;
-    Idle            maDockIdle;
-    Idle            maEndDockIdle;
+    Timer           m_aDockTimer;
+    Timer           m_aEndDockTimer;
     Point           maDockPos;
     tools::Rectangle       maDockRect;
     bool            mbInMove;
@@ -87,13 +87,15 @@ ImplDockFloatWin2::ImplDockFloatWin2( vcl::Window* pParent, WinBits nWinBits,
 
     SetBackground( GetSettings().GetStyleSettings().GetFaceColor() );
 
-    maDockIdle.SetInvokeHandler( LINK( this, ImplDockFloatWin2, DockTimerHdl ) );
-    maDockIdle.SetPriority( TaskPriority::HIGH_IDLE );
-    maDockIdle.SetDebugName( "vcl::ImplDockFloatWin2 maDockIdle" );
+    m_aDockTimer.SetInvokeHandler( LINK( this, ImplDockFloatWin2, DockTimerHdl ) );
+    m_aDockTimer.SetPriority( TaskPriority::HIGH_IDLE );
+    m_aDockTimer.SetTimeout( 50 );
+    m_aDockTimer.SetDebugName( "vcl::ImplDockFloatWin2 m_aDockTimer" );
 
-    maEndDockIdle.SetInvokeHandler( LINK( this, ImplDockFloatWin2, EndDockTimerHdl ) );
-    maEndDockIdle.SetPriority( TaskPriority::HIGH_IDLE );
-    maEndDockIdle.SetDebugName( "vcl::ImplDockFloatWin2 maEndDockIdle" );
+    m_aEndDockTimer.SetInvokeHandler( LINK( this, ImplDockFloatWin2, EndDockTimerHdl ) );
+    m_aEndDockTimer.SetPriority( TaskPriority::HIGH_IDLE );
+    m_aEndDockTimer.SetTimeout( 50 );
+    m_aEndDockTimer.SetDebugName( "vcl::ImplDockFloatWin2 m_aEndDockTimer" );
 }
 
 ImplDockFloatWin2::~ImplDockFloatWin2()
@@ -112,7 +114,6 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockTimerHdl, Timer *, void)
 {
     SAL_WARN_IF( !mpDockWin->IsFloatingMode(), "vcl", "docktimer called but not floating" );
 
-    maDockIdle.Stop();
     PointerState aState = GetPointerState();
 
     if( aState.mnState & KEY_MOD1 )
@@ -120,7 +121,7 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockTimerHdl, Timer *, void)
         // i43499 CTRL disables docking now
         mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking();
         if( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) )
-            maDockIdle.Start();
+            m_aDockTimer.Start();
     }
     else if( ! ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) )
     {
@@ -130,7 +131,7 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockTimerHdl, Timer *, void)
     else
     {
         mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->ShowTracking( maDockRect, ShowTrackFlags::Big | ShowTrackFlags::TrackWindow );
-        maDockIdle.Start();
+        m_aDockTimer.Start();
     }
 }
 
@@ -138,7 +139,6 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, EndDockTimerHdl, Timer *, void)
 {
     SAL_WARN_IF( !mpDockWin->IsFloatingMode(), "vcl", "enddocktimer called but not floating" );
 
-    maEndDockIdle.Stop();
     PointerState aState = GetPointerState();
     if( ! ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) )
     {
@@ -146,9 +146,7 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, EndDockTimerHdl, Timer *, void)
         mpDockWin->EndDocking( maDockRect, true );
     }
     else
-    {
-        maEndDockIdle.Start();
-    }
+        m_aEndDockTimer.Start();
 }
 
 IMPL_LINK_NOARG(ImplDockFloatWin2, DockingHdl, void*, void)
@@ -205,14 +203,14 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockingHdl, void*, void)
             maDockRect.SetPos( mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->ScreenToOutputPixel(
                  maDockRect.TopLeft() ) );
             mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->ShowTracking( maDockRect, ShowTrackFlags::Big | ShowTrackFlags::TrackWindow );
-            maEndDockIdle.Stop();
-            DockTimerHdl( nullptr );
+            m_aEndDockTimer.Stop();
+            m_aDockTimer.Invoke();
         }
         else
         {
             mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking();
-            maDockIdle.Stop();
-            EndDockTimerHdl( nullptr );
+            m_aDockTimer.Stop();
+            m_aEndDockTimer.Invoke();
         }
     }
     mbInMove = false;


More information about the Libreoffice-commits mailing list