Correct inital loading of BorderActivate

Summary:
We have a comma separated list:

"".split(',') returns ""
JS decides that's worth itterating over, and we implicitly cast "" to a
number which means we register on screen edge 0 (the top).

We can't use typeof or isFinite because valid entries are still strings
at this point.

Test Plan:
Ran with default config, no longer registered on top edge
Set an edge properly in the KCM. Still worked.

Reviewers: #plasma, mart

Reviewed By: mart

Subscribers: mart, plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4113
This commit is contained in:
David Edmundson 2017-01-13 15:18:18 +00:00
parent 84dd7d53ce
commit ddae039802

View file

@ -59,8 +59,11 @@ function init() {
var borders = readConfig("BorderActivate", "").toString().split(","); var borders = readConfig("BorderActivate", "").toString().split(",");
for (var i in borders) { for (var i in borders) {
registeredBorders.push(borders[i]); var border = borders[i];
registerScreenEdge(borders[i], minimizeAllWindows); if (border != "") {
registeredBorders.push(border);
registerScreenEdge(border, minimizeAllWindows);
}
} }
} }