Reset the count while the user keeps moving the mouse

re-trigger the edge *only* if the user keeps the mouse still for at
least edges()->reActivationThreshold() - edges()->timeThreshold()

so that the user has to actually keep moving.
if the user keeps moving the cursor in the direction of the edge, it
wion't continuously retrigger it

BUG:457280
This commit is contained in:
Marco Martin 2022-09-13 17:26:09 +00:00 committed by Nate Graham
parent 5dd8bf8e8b
commit 9965ca7fc0

View file

@ -295,6 +295,8 @@ bool Edge::check(const QPoint &cursorPos, const QDateTime &triggerTime, bool for
} }
if (m_lastTrigger.isValid() && // still in cooldown if (m_lastTrigger.isValid() && // still in cooldown
m_lastTrigger.msecsTo(triggerTime) < edges()->reActivationThreshold() - edges()->timeThreshold()) { m_lastTrigger.msecsTo(triggerTime) < edges()->reActivationThreshold() - edges()->timeThreshold()) {
// Reset the time, so the user has to actually keep the mouse still for this long to retrigger
m_lastTrigger = triggerTime;
return false; return false;
} }
// no pushback so we have to activate at once // no pushback so we have to activate at once