summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-01-03 16:43:30 +0300
committerCaolán McNamara <caolanm@redhat.com>2019-01-07 10:48:19 +0100
commit3d6ca7b271de18ba27a4d71ca7feef452e38c47c (patch)
tree643384184c5ddc8878ea0b93588a03de5e940fda /sw/source
parent808cc4d5fd87e6e6719a4a16f815e5897608bd2d (diff)
tdf#122442: use Timer to detect single-clicks vs double-clicks
Regression from commit 821ae0fb9fa63e0171f987d5ec210ec121978b8f which appeared after commits changing scheduler/main loop in the range e6e8a060ecc6e4fd51cfe88e00d841d546ed5915..9b4abcd1c45a646a1ac9120fe1c489ba6bb44e95 Change-Id: I6cf58c1e83aa9621bdd4b5c14f8565d5c69e20c1 Reviewed-on: https://gerrit.libreoffice.org/65837 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 6207c51880c9165eedb1d1af7fdc5e179bc8844d) Reviewed-on: https://gerrit.libreoffice.org/65842 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx10
-rw-r--r--sw/source/uibase/inc/edtwin.hxx2
2 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 3be0d47726de..c892f902fed0 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -4761,12 +4761,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
rSh.EnterStdMode();
rSh.SetVisibleCursor(aDocPt);
bCallBase = false;
- m_aTemplateIdle.Stop();
+ m_aTemplateTimer.Stop();
}
else if(rMEvt.GetClicks() == 1)
{
// no selection -> so turn off watering can
- m_aTemplateIdle.Start();
+ m_aTemplateTimer.Start();
}
}
}
@@ -5007,9 +5007,9 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView):
m_aKeyInputFlushTimer.SetInvokeHandler(LINK(this, SwEditWin, KeyInputFlushHandler));
// TemplatePointer for colors should be resetted without
- // selection after single click
- m_aTemplateIdle.SetPriority(TaskPriority::LOWEST);
- m_aTemplateIdle.SetInvokeHandler(LINK(this, SwEditWin, TemplateTimerHdl));
+ // selection after single click, but not after double-click (tdf#122442)
+ m_aTemplateTimer.SetTimeout(GetSettings().GetMouseSettings().GetDoubleClickTime());
+ m_aTemplateTimer.SetInvokeHandler(LINK(this, SwEditWin, TemplateTimerHdl));
// temporary solution!!! Should set the font of the current
// insert position at every cursor movement!
diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx
index 091b787d3a3c..b383025d5e57 100644
--- a/sw/source/uibase/inc/edtwin.hxx
+++ b/sw/source/uibase/inc/edtwin.hxx
@@ -80,7 +80,7 @@ class SwEditWin final : public vcl::Window,
Point m_aStartPos;
Point m_aMovePos;
Point m_aRszMvHdlPt;
- Idle m_aTemplateIdle;
+ Timer m_aTemplateTimer;
// type/object where the mouse pointer is
SwCallMouseEvent m_aSaveCallEvent;