From 981662a6b5e00a4fc01e264e79437a63344e5432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Thu, 24 Aug 2017 13:36:22 +0200 Subject: [PATCH] [effects] Don't register touch edges which don't exist Summary: Apparently some old configs made PresentWindows register the top left corner which does not make any sense as that's not supported by touch. So to be sure, don't register those edges. BUG: 383797 FIXED-IN: 5.11 Test Plan: Not tested, I'm on Wayland Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D7508 --- effects/cube/cube.cpp | 5 ++++- effects/desktopgrid/desktopgrid.cpp | 3 +++ effects/presentwindows/presentwindows.cpp | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index 46ba7d62d8..3e924511d3 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -228,8 +228,11 @@ void CubeEffect::reconfigure(ReconfigureFlags) effects->unregisterTouchBorder(e, m_sphereAction); effects->unregisterTouchBorder(e, m_cylinderAction); } - auto touchEdge = [] (const QList touchBorders, QAction *action) { + auto touchEdge = [&relevantBorders] (const QList touchBorders, QAction *action) { for (int i : touchBorders) { + if (!relevantBorders.contains(ElectricBorder(i))) { + continue; + } effects->registerTouchBorder(ElectricBorder(i), action); } }; diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp index c47c0824aa..82c6d308e9 100644 --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -127,6 +127,9 @@ void DesktopGridEffect::reconfigure(ReconfigureFlags) } const auto touchBorders = DesktopGridConfig::touchBorderActivate(); for (int i : touchBorders) { + if (!relevantBorders.contains(ElectricBorder(i))) { + continue; + } effects->registerTouchBorder(ElectricBorder(i), m_activateAction); } } diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index 7ec058263a..51182c47a2 100755 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -166,8 +166,11 @@ void PresentWindowsEffect::reconfigure(ReconfigureFlags) effects->unregisterTouchBorder(e, m_exposeAllAction); effects->unregisterTouchBorder(e, m_exposeClassAction); } - auto touchEdge = [] (const QList touchBorders, QAction *action) { + auto touchEdge = [&relevantBorders] (const QList touchBorders, QAction *action) { for (int i : touchBorders) { + if (!relevantBorders.contains(ElectricBorder(i))) { + continue; + } effects->registerTouchBorder(ElectricBorder(i), action); } };