From ddae0398027b681e13519fd809eaf22355bff6b1 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 13 Jan 2017 15:18:18 +0000 Subject: [PATCH] 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 --- scripts/minimizeall/contents/code/main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/minimizeall/contents/code/main.js b/scripts/minimizeall/contents/code/main.js index d87c187a47..a293ec17b1 100644 --- a/scripts/minimizeall/contents/code/main.js +++ b/scripts/minimizeall/contents/code/main.js @@ -59,8 +59,11 @@ function init() { var borders = readConfig("BorderActivate", "").toString().split(","); for (var i in borders) { - registeredBorders.push(borders[i]); - registerScreenEdge(borders[i], minimizeAllWindows); + var border = borders[i]; + if (border != "") { + registeredBorders.push(border); + registerScreenEdge(border, minimizeAllWindows); + } } }