Commit 981662a6 authored by Martin Flöser's avatar Martin Flöser

[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
parent 80c3fdd6
......@@ -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);
}
};
......
......@@ -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);
}
}
......
......@@ -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);
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment