Bug 351627 - ScreenEdges::handleEnterNotifiy() an ScreenEdges::check() are called in a row, causing a double handleByCallback()
Summary: ScreenEdges::handleEnterNotifiy() an ScreenEdges::check() are called in a row...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-22 20:49 UTC by Thomas Lübking
Modified: 2015-08-27 21:23 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.4.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Lübking 2015-08-22 20:49:44 UTC
What leads to double activation of callbacks - in case of at least the tabbox that's a toggle and this means you get a "show();" first and then an "accept();" before you can even spot the tabbox.

Btw: "handleEnterNotifiy"? ;-P

Reproducible: Always
Comment 1 Thomas Lübking 2015-08-23 07:18:01 UTC
diff --git a/screenedge.cpp b/screenedge.cpp
index 35d84a0..b657675 100644
--- a/screenedge.cpp
+++ b/screenedge.cpp
@@ -137,6 +137,10 @@ bool Edge::check(const QPoint &cursorPos, const QDateTime &triggerTime, bool for
     if (!triggersFor(cursorPos)) {
         return false;
     }
+    if (m_lastTrigger.isValid() && // still in cooldown
+        m_lastTrigger.msecsTo(triggerTime) < edges()->reActivationThreshold()) {
+        return false;
+    }
     // no pushback so we have to activate at once
     bool directActivate = forceNoPushBack || edges()->cursorPushBackDistance().isNull() || m_client;
     if (directActivate || canActivate(cursorPos, triggerTime)) {
Comment 2 Martin Flöser 2015-08-24 06:43:40 UTC
Shouldn't be the check in Edge::canActivate?
Comment 3 Thomas Lübking 2015-08-24 06:46:39 UTC
Check is  there, but bypassed by the directActivate (notably the forceNoPushBack part) check.
Those however do not matter; during the cooldown, there must be no trigger.
Comment 4 Martin Flöser 2015-08-24 06:53:26 UTC
Sounds reasonable ;-) Thanks for explaining.
Comment 5 Thomas Lübking 2015-08-27 21:23:16 UTC
Git commit 9139cca72c5612482c8c27e70196d583630772af by Thomas Lübking.
Committed on 27/08/2015 at 20:21.
Pushed by luebking into branch 'Plasma/5.4'.

never trigger edges during the cooldown

regardless of whether the pushback is forced down or the user
has deactivated it or whatever. The edge is waiting from previous
activation and we need to prevent immediate reactivation since that
may cause duplicate action and unwanted state toggles
Related: bug 351869
FIXED-IN: 5.4.1
REVIEW: 124888

M  +4    -0    screenedge.cpp

http://commits.kde.org/kwin/9139cca72c5612482c8c27e70196d583630772af