summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-08-25 02:35:26 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-09-20 17:44:22 +0200
commite3a745f7604b084a7bb5fb6f18d5b50b5e137a98 (patch)
tree3bc85cb0a4096363cbb4b46630b52448f8c9238d
parentfbc3818a70bad11f2b28d005d97c3491a41f711e (diff)
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@fbihome.de> (cherry picked from commit afd49c198769b5e7fc01a68ce7a6847aa0d0ddd8) Reviewed-on: https://gerrit.libreoffice.org/60720 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/source/window/dockmgr.cxx36
1 files changed, 17 insertions, 19 deletions
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index eb27e3e18c05..9846bc45549b 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -42,8 +42,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;
@@ -86,13 +86,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()
@@ -111,7 +113,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 )
@@ -119,7 +120,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 ) ) )
{
@@ -129,7 +130,7 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockTimerHdl, Timer *, void)
else
{
mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->ShowTracking( maDockRect, ShowTrackFlags::Big | ShowTrackFlags::TrackWindow );
- maDockIdle.Start();
+ m_aDockTimer.Start();
}
}
@@ -137,7 +138,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 ) ) )
{
@@ -145,9 +145,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)
@@ -204,14 +202,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;