From 1d3a1aa061a79ca4fa21ffef6310f85ffcd32f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Thu, 10 Sep 2015 21:03:53 +0200 Subject: [PATCH] restore linked screenedges times commit c6bd68d78a2e00ce094a4087c106aaf4067f9f57 fixed a bug that allowed early invocation when pushback was forced down. However, it also turned activation and re-activation time additive again (ie. invocation could only happen after r+a ms instead of after r ms) see also REVIEW 124888 REVIEW: 125143 --- screenedge.cpp | 4 ++-- screenedge.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/screenedge.cpp b/screenedge.cpp index b657675e54..fc94968622 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -138,7 +138,7 @@ bool Edge::check(const QPoint &cursorPos, const QDateTime &triggerTime, bool for return false; } if (m_lastTrigger.isValid() && // still in cooldown - m_lastTrigger.msecsTo(triggerTime) < edges()->reActivationThreshold()) { + m_lastTrigger.msecsTo(triggerTime) < edges()->reActivationThreshold() - edges()->timeThreshold()) { return false; } // no pushback so we have to activate at once @@ -171,7 +171,7 @@ bool Edge::canActivate(const QPoint &cursorPos, const QDateTime &triggerTime) m_lastReset = triggerTime; return false; } - if (m_lastTrigger.isValid() && m_lastTrigger.msecsTo(triggerTime) < edges()->reActivationThreshold()) { + if (m_lastTrigger.isValid() && m_lastTrigger.msecsTo(triggerTime) < edges()->reActivationThreshold() - edges()->timeThreshold()) { return false; } if (m_lastReset.msecsTo(triggerTime) < edges()->timeThreshold()) { diff --git a/screenedge.h b/screenedge.h index 4e3520d867..ccd9fcade8 100644 --- a/screenedge.h +++ b/screenedge.h @@ -564,6 +564,7 @@ inline void ScreenEdges::setDesktopSwitchingMovingClients(bool enable) inline void ScreenEdges::setReActivationThreshold(int threshold) { + Q_ASSERT(threshold >= m_timeThreshold); m_reactivateThreshold = threshold; }