[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
This commit is contained in:
Martin Flöser 2017-08-24 13:36:22 +02:00
parent 80c3fdd684
commit 981662a6b5
3 changed files with 11 additions and 2 deletions

View file

@ -228,8 +228,11 @@ void CubeEffect::reconfigure(ReconfigureFlags)
effects->unregisterTouchBorder(e, m_sphereAction);
effects->unregisterTouchBorder(e, m_cylinderAction);
}
auto touchEdge = [] (const QList<int> touchBorders, QAction *action) {
auto touchEdge = [&relevantBorders] (const QList<int> touchBorders, QAction *action) {
for (int i : touchBorders) {
if (!relevantBorders.contains(ElectricBorder(i))) {
continue;
}
effects->registerTouchBorder(ElectricBorder(i), action);
}
};

View file

@ -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);
}
}

View file

@ -166,8 +166,11 @@ void PresentWindowsEffect::reconfigure(ReconfigureFlags)
effects->unregisterTouchBorder(e, m_exposeAllAction);
effects->unregisterTouchBorder(e, m_exposeClassAction);
}
auto touchEdge = [] (const QList<int> touchBorders, QAction *action) {
auto touchEdge = [&relevantBorders] (const QList<int> touchBorders, QAction *action) {
for (int i : touchBorders) {
if (!relevantBorders.contains(ElectricBorder(i))) {
continue;
}
effects->registerTouchBorder(ElectricBorder(i), action);
}
};