Do not handle ScreenEdges::check for Edges which don't activate for Pointer

Summary:
On X11 the edges reserved only for pointer started to show the approach
geometry. This problem is addressed by this change.

Touch screen events do not go through this method, neither is it used on
Wayland.

Test Plan: Tested on X11, problem fixed

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5421
This commit is contained in:
Martin Gräßlin 2017-04-13 07:00:30 +02:00
parent 873a51cc62
commit c3ecf55bf8
2 changed files with 6 additions and 0 deletions

View file

@ -918,6 +918,9 @@ void TestScreenEdges::testTouchEdge()
setPos(QPoint(0, 50)); setPos(QPoint(0, 50));
QCOMPARE(s->isEntered(&event), false); QCOMPARE(s->isEntered(&event), false);
QVERIFY(approachingSpy.isEmpty()); QVERIFY(approachingSpy.isEmpty());
// let's also verify the check
s->check(QPoint(0, 50), QDateTime::currentDateTime(), false);
QVERIFY(approachingSpy.isEmpty());
s->gestureRecognizer()->startSwipeGesture(QPoint(0, 50)); s->gestureRecognizer()->startSwipeGesture(QPoint(0, 50));
QCOMPARE(approachingSpy.count(), 1); QCOMPARE(approachingSpy.count(), 1);

View file

@ -1339,6 +1339,9 @@ void ScreenEdges::check(const QPoint &pos, const QDateTime &now, bool forceNoPus
if (!(*it)->isReserved()) { if (!(*it)->isReserved()) {
continue; continue;
} }
if (!(*it)->activatesForPointer()) {
continue;
}
if ((*it)->approachGeometry().contains(pos)) { if ((*it)->approachGeometry().contains(pos)) {
(*it)->startApproaching(); (*it)->startApproaching();
} }