From 65c2761c91719915839ee4894574eb349610c7e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor=20Pessoa?= Date: Fri, 2 Oct 2020 19:24:06 -0300 Subject: [PATCH] Issue #1189: Add click option to Toggle single / Cycle multiple --- Settings.ui | 2 ++ appIcons.js | 19 ++++++++++++++++--- ...shell.extensions.dash-to-panel.gschema.xml | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Settings.ui b/Settings.ui index 551085b..8a0b131 100644 --- a/Settings.ui +++ b/Settings.ui @@ -133,6 +133,7 @@ Cycle through windows Cycle windows + minimize Toggle single / Preview multiple + Toggle single / Cycle multiple Quit @@ -6525,6 +6526,7 @@ Cycle windows + minimize Cycle through windows Toggle single / Preview multiple + Toggle single / Cycle multiple Toggle windows Raise windows Launch new instance diff --git a/appIcons.js b/appIcons.js index 2279057..d4fcf75 100644 --- a/appIcons.js +++ b/appIcons.js @@ -811,9 +811,9 @@ var taskbarAppIcon = Utils.defineClass({ if (this.window && !handleAsGrouped) { //ungrouped applications behaviors switch (buttonAction) { - case 'RAISE': case 'CYCLE': case 'CYCLE-MIN': case 'MINIMIZE': case 'TOGGLE-SHOWPREVIEW': + case 'RAISE': case 'CYCLE': case 'CYCLE-MIN': case 'MINIMIZE': case 'TOGGLE-SHOWPREVIEW': case 'TOGGLE-CYCLE': if (!Main.overview._shown && - (buttonAction == 'MINIMIZE' || buttonAction == 'TOGGLE-SHOWPREVIEW' || buttonAction == 'CYCLE-MIN') && + (buttonAction == 'MINIMIZE' || buttonAction == 'TOGGLE-SHOWPREVIEW' || buttonAction == 'TOGGLE-CYCLE' || buttonAction == 'CYCLE-MIN') && (this._isFocusedWindow() || (buttonAction == 'MINIMIZE' && (button == 2 || modifiers & Clutter.ModifierType.SHIFT_MASK)))) { this.window.minimize(); } else { @@ -906,7 +906,20 @@ var taskbarAppIcon = Utils.defineClass({ else this.app.activate(); break; - + case "TOGGLE-CYCLE": + if (!Main.overview._shown) { + if (appCount == 1) { + if (appHasFocus) + minimizeWindow(this.app, false, monitor); + else + activateFirstWindow(this.app, monitor); + } else { + cycleThroughWindows(this.app, false, false, monitor); + } + } + else + this.app.activate(); + break; case "QUIT": closeAllWindows(this.app, monitor); break; diff --git a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml index 5cf666d..e044f74 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -17,6 +17,7 @@ +