Kaydet (Commit) 6207c518 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#122442: use Timer to detect single-clicks vs double-clicks

Regression from commit 821ae0fb which
appeared after commits changing scheduler/main loop in the range
e6e8a060..9b4abcd1

Change-Id: I6cf58c1e83aa9621bdd4b5c14f8565d5c69e20c1
Reviewed-on: https://gerrit.libreoffice.org/65837
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 1f6506ca
...@@ -4756,12 +4756,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -4756,12 +4756,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
rSh.EnterStdMode(); rSh.EnterStdMode();
rSh.SetVisibleCursor(aDocPt); rSh.SetVisibleCursor(aDocPt);
bCallBase = false; bCallBase = false;
m_aTemplateIdle.Stop(); m_aTemplateTimer.Stop();
} }
else if(rMEvt.GetClicks() == 1) else if(rMEvt.GetClicks() == 1)
{ {
// no selection -> so turn off watering can // no selection -> so turn off watering can
m_aTemplateIdle.Start(); m_aTemplateTimer.Start();
} }
} }
} }
...@@ -4997,9 +4997,9 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView): ...@@ -4997,9 +4997,9 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView):
m_aKeyInputFlushTimer.SetInvokeHandler(LINK(this, SwEditWin, KeyInputFlushHandler)); m_aKeyInputFlushTimer.SetInvokeHandler(LINK(this, SwEditWin, KeyInputFlushHandler));
// TemplatePointer for colors should be resetted without // TemplatePointer for colors should be resetted without
// selection after single click // selection after single click, but not after double-click (tdf#122442)
m_aTemplateIdle.SetPriority(TaskPriority::LOWEST); m_aTemplateTimer.SetTimeout(GetSettings().GetMouseSettings().GetDoubleClickTime());
m_aTemplateIdle.SetInvokeHandler(LINK(this, SwEditWin, TemplateTimerHdl)); m_aTemplateTimer.SetInvokeHandler(LINK(this, SwEditWin, TemplateTimerHdl));
// temporary solution!!! Should set the font of the current // temporary solution!!! Should set the font of the current
// insert position at every cursor movement! // insert position at every cursor movement!
......
...@@ -81,7 +81,7 @@ class SwEditWin final : public vcl::Window, ...@@ -81,7 +81,7 @@ class SwEditWin final : public vcl::Window,
Point m_aStartPos; Point m_aStartPos;
Point m_aMovePos; Point m_aMovePos;
Point m_aRszMvHdlPt; Point m_aRszMvHdlPt;
Idle m_aTemplateIdle; Timer m_aTemplateTimer;
// type/object where the mouse pointer is // type/object where the mouse pointer is
SwCallMouseEvent m_aSaveCallEvent; SwCallMouseEvent m_aSaveCallEvent;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment