From eec6afe6f5fef80f519c7afb33e4fd568d74aab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 20 Apr 2017 20:09:22 +0200 Subject: [PATCH] Don't map screenedge approach window if edge is only used for touch Summary: Another regression from enabling touch support on X11. The approach window for pointer input gets unmapped as soon as the mouse enters the window. This ensures that mouse motion events are not stolen from other applications. But with the touch events we did not even react on the enter event if it's not activated for pointer. The result was an area around the screenedge being blocked for pointer input. This change only creates and maps the approach window if the edge is activated for pointer input. BUG: 378951 Test Plan: Activated edges through pointer and touch, reconfigured and tested motion events Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D5528 --- plugins/platforms/x11/standalone/edge.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/platforms/x11/standalone/edge.cpp b/plugins/platforms/x11/standalone/edge.cpp index 544e78d67e..cb77854e45 100644 --- a/plugins/platforms/x11/standalone/edge.cpp +++ b/plugins/platforms/x11/standalone/edge.cpp @@ -77,6 +77,9 @@ void WindowBasedEdge::createWindow() void WindowBasedEdge::createApproachWindow() { + if (!activatesForPointer()) { + return; + } if (m_approachWindow.isValid()) { return; } @@ -95,11 +98,16 @@ void WindowBasedEdge::createApproachWindow() void WindowBasedEdge::doGeometryUpdate() { m_window.setGeometry(geometry()); - m_approachWindow.setGeometry(approachGeometry()); + if (m_approachWindow.isValid()) { + m_approachWindow.setGeometry(approachGeometry()); + } } void WindowBasedEdge::doStartApproaching() { + if (!activatesForPointer()) { + return; + } m_approachWindow.unmap(); Cursor *cursor = Cursor::self(); connect(cursor, SIGNAL(posChanged(QPoint)), SLOT(updateApproaching(QPoint))); @@ -108,6 +116,9 @@ void WindowBasedEdge::doStartApproaching() void WindowBasedEdge::doStopApproaching() { + if (!activatesForPointer()) { + return; + } Cursor *cursor = Cursor::self(); disconnect(cursor, SIGNAL(posChanged(QPoint)), this, SLOT(updateApproaching(QPoint))); cursor->stopMousePolling(); @@ -119,6 +130,9 @@ void WindowBasedEdge::doUpdateBlocking() if (!isReserved()) { return; } + if (!activatesForPointer()) { + return; + } if (isBlocked()) { m_window.unmap(); m_approachWindow.unmap();