aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2016-10-07 15:21:56 +0100
committerDavid Edmundson <[email protected]>2016-10-07 15:21:56 +0100
commit530682f7b8273cf42cd14ccd8d0dc6cd64f81c58 (patch)
tree31d3e2aa9d628d723a1f9409bef365562690b986
parent4bb12f3f010d41f1d443abde2212ea6418382676 (diff)
Add possible border handling in minimize all script
Summary: Adds screen edge handling in minimize all script. Test Plan: With a hacked KCM, setting the option works perfectly and updates correctly adding/removing the edge bindings as appropriate. Reviewers: #plasma, graesslin Reviewed By: #plasma, graesslin Subscribers: graesslin, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D2263
-rw-r--r--scripts/minimizeall/contents/code/main.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/minimizeall/contents/code/main.js b/scripts/minimizeall/contents/code/main.js
index a8e17e8..d87c187 100644
--- a/scripts/minimizeall/contents/code/main.js
+++ b/scripts/minimizeall/contents/code/main.js
@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
+var registeredBorders = [];
+
function isRelevant(client) {
return client.minimizable &&
(client.onAllDesktops || client.desktop === workspace.currentDesktop);
@@ -48,4 +50,21 @@ var minimizeAllWindows = function() {
clients = [];
}
+function init() {
+ for (var i in registeredBorders) {
+ unregisterScreenEdge(registeredBorders[i]);
+ }
+
+ registeredBorders = [];
+
+ var borders = readConfig("BorderActivate", "").toString().split(",");
+ for (var i in borders) {
+ registeredBorders.push(borders[i]);
+ registerScreenEdge(borders[i], minimizeAllWindows);
+ }
+}
+
+options.configChanged.connect(init);
+
registerShortcut("MinimizeAll", "MinimizeAll", "Meta+Shift+D", minimizeAllWindows);
+init();