diff options
Diffstat (limited to 'extensions/46/middleclickclose/src')
-rw-r--r-- | extensions/46/middleclickclose/src/extension.js | 91 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/metadata.json | 3 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/po/de.po | 30 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/po/el.po | 40 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/po/fr.po | 30 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/po/it.po | 30 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/po/nl.po | 30 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/po/pt.po | 34 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/po/sk.po | 30 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/po/sr.po | 30 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/po/sr@latin.po | 36 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/po/template.pot | 30 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/po/uk.po | 34 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/prefs.js | 24 | ||||
-rw-r--r-- | extensions/46/middleclickclose/src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml | 5 |
15 files changed, 334 insertions, 143 deletions
diff --git a/extensions/46/middleclickclose/src/extension.js b/extensions/46/middleclickclose/src/extension.js index 0b0d562..69f4c7e 100644 --- a/extensions/46/middleclickclose/src/extension.js +++ b/extensions/46/middleclickclose/src/extension.js @@ -19,9 +19,13 @@ import GLib from 'gi://GLib'; import GObject from 'gi://GObject'; +import Meta from 'gi://Meta'; -import { Extension, InjectionManager } from 'resource:///org/gnome/shell/extensions/extension.js'; +import { Extension, InjectionManager } + from 'resource:///org/gnome/shell/extensions/extension.js'; import { Workspace } from 'resource:///org/gnome/shell/ui/workspace.js'; +import { WindowPreview } from 'resource:///org/gnome/shell/ui/windowPreview.js'; +import { ControlsState } from 'resource:///org/gnome/shell/ui/overviewControls.js'; import { SettingsWatch } from './settingsWatch.js'; @@ -29,21 +33,29 @@ export default class MiddleClickClose extends Extension { #settings; #injectionManager; + #refocusOnClose; + enable() { this.#settings = new SettingsWatch(this.getSettings(), { close_button: { get: v => v.value, }, rearrange_delay: {}, + keyboard_close: {}, }); + this.#refocusOnClose = new WeakSet(); + this.#injectionManager = new InjectionManager(); this.#patchClickHandler(); this.#patchWindowRepositioningDelay(); + this.#patchKeyClose(); } disable() { this.#injectionManager.clear(); this.#injectionManager = null; + this.#refocusOnClose = null; + this.#settings.clear(); this.#settings = null; } @@ -81,23 +93,90 @@ export default class MiddleClickClose extends Extension { // apparently that is impossible with the switch to ESM. Instead, we'll monkey-patch // _doRemoveWindow() and change the timeout after the fact. const settings = this.#settings; + const refocusOnClose = this.#refocusOnClose; const lastLayoutFrozenIds = new WeakMap(); + this.#injectionManager.overrideMethod(Workspace.prototype, '_doRemoveWindow', - original => function () { + original => function (metaWin) { + + // Grab the old window's focus chain index. + let focus_idx = this.get_focus_chain() + .findIndex(clone => clone.metaWindow == metaWin); + + // Call the original method. const ret = original.apply(this, arguments); + if (refocusOnClose.has(metaWin)) { + // Find a "nearby" window to refocus to, based on the old index + const chain = this.get_focus_chain(); + if (focus_idx >= chain.length) { + focus_idx = chain.length - 1; + } + + // Focus on the selected window. + if (focus_idx >= 0) { + global.stage.key_focus = chain[focus_idx]; + } + } + // Adjust the freeze delay. if (this._layoutFrozenId > 0 && this._layoutFrozenId != lastLayoutFrozenIds.get(this) ) { - const source = GLib.MainContext.default().find_source_by_id(this._layoutFrozenId); - source.set_ready_time(source.get_time() + settings.rearrange_delay * 1000); + const src = GLib.MainContext.default().find_source_by_id(this._layoutFrozenId); + src.set_ready_time(src.get_time() + settings.rearrange_delay * 1000); } - // Need to keep the last id to avoid adjusting the layout freeze delay more than once. + // Need to keep the last id to avoid adjusting the layout freeze delay more than + // once. lastLayoutFrozenIds.set(this, this._layoutFrozenId); - return ret; }) } + + #patchKeyClose() { + // If Meta.KeyBindingAction.CLOSE is fired in while a WindowPreview is focused, close it. + const settings = this.#settings; + const refocusOnClose = this.#refocusOnClose; + + function handleKeyPress(event) { + + // Keyboard close disabled in settings. + if (!settings.keyboard_close) { + return false; + } + + // We only care about window picker mode. + if (this._workspace._overviewAdjustment.value !== ControlsState.WINDOW_PICKER) { + return false; + } + + const action = global.display.get_keybinding_action( + event.get_key_code(), event.get_state()); + if (action == Meta.KeyBindingAction.CLOSE) { + + if (this._workspace.metaWorkspace?.active) { + // Imediately refocus on another window when closing via keyboard. + refocusOnClose.add(this.metaWindow); + + // Close the window. + this._deleteAll(); + } else { + // Switch to the workspace the focused window is in. + this._workspace.metaWorkspace?.activate(global.get_current_time()) + } + + return true; + } + + return false; + } + + this.#injectionManager.overrideMethod(WindowPreview.prototype, 'vfunc_key_press_event', + original => function () { + return handleKeyPress.apply(this, arguments) + || original.apply(this, arguments); + } + ) + } }; diff --git a/extensions/46/middleclickclose/src/metadata.json b/extensions/46/middleclickclose/src/metadata.json index 8802f6d..23bc0ed 100644 --- a/extensions/46/middleclickclose/src/metadata.json +++ b/extensions/46/middleclickclose/src/metadata.json @@ -4,7 +4,8 @@ "url": "https://github.com/p91paul/middleclickclose", "shell-version": [ "45", - "46" + "46", + "47" ], "uuid": "middleclickclose@paolo.tranquilli.gmail.com", "settings-schema": "org.gnome.shell.extensions.middleclickclose", diff --git a/extensions/46/middleclickclose/src/po/de.po b/extensions/46/middleclickclose/src/po/de.po index 4fb4821..cf12acc 100644 --- a/extensions/46/middleclickclose/src/po/de.po +++ b/extensions/46/middleclickclose/src/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-30 18:29+0300\n" +"POT-Creation-Date: 2024-07-09 15:57+0300\n" "PO-Revision-Date: 2019-06-17 20:44+0200\n" "Last-Translator: Onno Giesmann <nutzer3105@gmail.com>\n" "Language-Team: German <--->\n" @@ -18,39 +18,39 @@ msgstr "" "X-Generator: Gtranslator 3.32.1\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -#: src/prefs.js:30 +#: src/prefs.js:31 msgid "Left" msgstr "Linke" -#: src/prefs.js:31 +#: src/prefs.js:32 msgid "Middle" msgstr "Mittlere" -#: src/prefs.js:32 +#: src/prefs.js:33 msgid "Right" msgstr "Rechte" -#: src/prefs.js:33 +#: src/prefs.js:34 msgid "Button 4" msgstr "Taste 4" -#: src/prefs.js:34 +#: src/prefs.js:35 msgid "Button 5" msgstr "Taste 5" -#: src/prefs.js:35 +#: src/prefs.js:36 msgid "Button 6" msgstr "Taste 6" -#: src/prefs.js:36 +#: src/prefs.js:37 msgid "Button 7" msgstr "Taste 7" -#: src/prefs.js:37 +#: src/prefs.js:38 msgid "Button 8" msgstr "Taste 8" -#: src/prefs.js:38 +#: src/prefs.js:39 msgid "Button 9" msgstr "Taste 9" @@ -62,11 +62,19 @@ msgstr "Maustaste zum Schließen" msgid "Which mouse button triggers closing in overview." msgstr "Gibt an, welche Maustaste das Schließen in der Übersicht auslöst." +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 +msgid "Close with keyboard" +msgstr "" + #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:23 +msgid "Allow closing windows in overview via keyboard shortcuts." +msgstr "" + +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:28 msgid "Rearrange delay" msgstr "Verzögerung bis zur Neuanordnung" -#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:24 +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:29 msgid "" "How much time must pass with the pointer not moving for windows in overview " "to rearrange after one was closed." diff --git a/extensions/46/middleclickclose/src/po/el.po b/extensions/46/middleclickclose/src/po/el.po index d032228..cc5f21e 100644 --- a/extensions/46/middleclickclose/src/po/el.po +++ b/extensions/46/middleclickclose/src/po/el.po @@ -7,49 +7,49 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-30 18:33+0300\n" -"PO-Revision-Date: 2023-08-30 18:41+0300\n" +"POT-Creation-Date: 2024-07-09 15:57+0300\n" +"PO-Revision-Date: 2024-07-09 16:01+0300\n" "Last-Translator: George Tsiamasiotis <gtsiam@windowslive.com>\n" "Language-Team: \n" "Language: el\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.3.2\n" +"X-Generator: Poedit 3.4.2\n" -#: src/prefs.js:30 +#: src/prefs.js:31 msgid "Left" msgstr "Αριστερό" -#: src/prefs.js:31 +#: src/prefs.js:32 msgid "Middle" msgstr "Μεσαίο" -#: src/prefs.js:32 +#: src/prefs.js:33 msgid "Right" msgstr "Δεξί" -#: src/prefs.js:33 +#: src/prefs.js:34 msgid "Button 4" msgstr "Κουμπί 4" -#: src/prefs.js:34 +#: src/prefs.js:35 msgid "Button 5" msgstr "Κουμπί 5" -#: src/prefs.js:35 +#: src/prefs.js:36 msgid "Button 6" msgstr "Κουμπί 6" -#: src/prefs.js:36 +#: src/prefs.js:37 msgid "Button 7" msgstr "Κουμπί 7" -#: src/prefs.js:37 +#: src/prefs.js:38 msgid "Button 8" msgstr "Κουμπί 8" -#: src/prefs.js:38 +#: src/prefs.js:39 msgid "Button 9" msgstr "Κουμπί 9" @@ -61,14 +61,24 @@ msgstr "Κουμπί ποντικιού για κλείσιμο" msgid "Which mouse button triggers closing in overview." msgstr "Ποιό κουμπί του ποντικιού κλείνει παράθυρα στην επισκόπηση." +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 +msgid "Close with keyboard" +msgstr "Κλείσιμο με πληκτρολόγιο" + #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:23 +msgid "Allow closing windows in overview via keyboard shortcuts." +msgstr "" +"Επιτρέπει το κλείσιμο παραθύρων στην επισκόπηση μέσω συντομεύσεων " +"πληκτρολογίου." + +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:28 msgid "Rearrange delay" msgstr "Καθυστέρηση ανακατονομής" -#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:24 +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:29 msgid "" "How much time must pass with the pointer not moving for windows in overview " "to rearrange after one was closed." msgstr "" -"Πόσος χρόνος πρέπει να περάσει με τον κέρσορα αδρανή στην επισκόπηση μετά " -"το κλείσιμο ενός παραθύρου για να γίνει ανακατανομή." +"Πόσος χρόνος πρέπει να περάσει με τον κέρσορα αδρανή στην επισκόπηση μετά το " +"κλείσιμο ενός παραθύρου για να γίνει ανακατανομή." diff --git a/extensions/46/middleclickclose/src/po/fr.po b/extensions/46/middleclickclose/src/po/fr.po index e762a40..f7acb45 100644 --- a/extensions/46/middleclickclose/src/po/fr.po +++ b/extensions/46/middleclickclose/src/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-30 18:29+0300\n" +"POT-Creation-Date: 2024-07-09 15:57+0300\n" "PO-Revision-Date: 2015-12-30 07:08+0100\n" "Last-Translator: DAEM Q.\n" "Language-Team: \n" @@ -18,39 +18,39 @@ msgstr "" "X-Generator: Poedit 1.8.5\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -#: src/prefs.js:30 +#: src/prefs.js:31 msgid "Left" msgstr "Gauche" -#: src/prefs.js:31 +#: src/prefs.js:32 msgid "Middle" msgstr "Milieu" -#: src/prefs.js:32 +#: src/prefs.js:33 msgid "Right" msgstr "Droit" -#: src/prefs.js:33 +#: src/prefs.js:34 msgid "Button 4" msgstr "Bouton 4" -#: src/prefs.js:34 +#: src/prefs.js:35 msgid "Button 5" msgstr "Bouton 5" -#: src/prefs.js:35 +#: src/prefs.js:36 msgid "Button 6" msgstr "Bouton 6" -#: src/prefs.js:36 +#: src/prefs.js:37 msgid "Button 7" msgstr "Bouton 7" -#: src/prefs.js:37 +#: src/prefs.js:38 msgid "Button 8" msgstr "Bouton 8" -#: src/prefs.js:38 +#: src/prefs.js:39 msgid "Button 9" msgstr "Bouton 9" @@ -64,11 +64,19 @@ msgstr "" "Le bouton de la souris qui déclenche la fermeture d'une fenêtre dans la Vue " "d'ensemble." +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 +msgid "Close with keyboard" +msgstr "" + #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:23 +msgid "Allow closing windows in overview via keyboard shortcuts." +msgstr "" + +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:28 msgid "Rearrange delay" msgstr "Délai avant réarrangement" -#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:24 +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:29 msgid "" "How much time must pass with the pointer not moving for windows in overview " "to rearrange after one was closed." diff --git a/extensions/46/middleclickclose/src/po/it.po b/extensions/46/middleclickclose/src/po/it.po index 4b20c55..dbb0a96 100644 --- a/extensions/46/middleclickclose/src/po/it.po +++ b/extensions/46/middleclickclose/src/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-30 18:29+0300\n" +"POT-Creation-Date: 2024-07-09 15:57+0300\n" "PO-Revision-Date: 2017-04-21 10:06+0200\n" "Last-Translator: Jimmy Scionti <jimmy.scionti@gmail.com>\n" "Language-Team: Jimmy Scionti <jimmy.scionti@gmail.com>\n" @@ -18,39 +18,39 @@ msgstr "" "X-Generator: Poedit 1.8.7.1\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/prefs.js:30 +#: src/prefs.js:31 msgid "Left" msgstr "Sinistro" -#: src/prefs.js:31 +#: src/prefs.js:32 msgid "Middle" msgstr "Centrale" -#: src/prefs.js:32 +#: src/prefs.js:33 msgid "Right" msgstr "Destro" -#: src/prefs.js:33 +#: src/prefs.js:34 msgid "Button 4" msgstr "Pulsante 4" -#: src/prefs.js:34 +#: src/prefs.js:35 msgid "Button 5" msgstr "Pulsante 5" -#: src/prefs.js:35 +#: src/prefs.js:36 msgid "Button 6" msgstr "Pulsante 6" -#: src/prefs.js:36 +#: src/prefs.js:37 msgid "Button 7" msgstr "Pulsante 7" -#: src/prefs.js:37 +#: src/prefs.js:38 msgid "Button 8" msgstr "Pulsante 8" -#: src/prefs.js:38 +#: src/prefs.js:39 msgid "Button 9" msgstr "Pulsante 9" @@ -62,11 +62,19 @@ msgstr "Pulsante del mouse per chiudere la finestra" msgid "Which mouse button triggers closing in overview." msgstr "Seleziona quale pulsante del mouse premere per chiudere una finestra." +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 +msgid "Close with keyboard" +msgstr "" + #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:23 +msgid "Allow closing windows in overview via keyboard shortcuts." +msgstr "" + +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:28 msgid "Rearrange delay" msgstr "Ritardo del riordinamento" -#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:24 +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:29 msgid "" "How much time must pass with the pointer not moving for windows in overview " "to rearrange after one was closed." diff --git a/extensions/46/middleclickclose/src/po/nl.po b/extensions/46/middleclickclose/src/po/nl.po index fe9c6e9..39aa13c 100644 --- a/extensions/46/middleclickclose/src/po/nl.po +++ b/extensions/46/middleclickclose/src/po/nl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-30 18:29+0300\n" +"POT-Creation-Date: 2024-07-09 15:57+0300\n" "PO-Revision-Date: 2019-09-15 20:17+0200\n" "Last-Translator: Heimen Stoffels <vistausss@outlook.com>\n" "Language-Team: Dutch <kde-i18n-doc@kde.org>\n" @@ -17,39 +17,39 @@ msgstr "" "X-Generator: Poedit 2.2.1\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/prefs.js:30 +#: src/prefs.js:31 msgid "Left" msgstr "Links" -#: src/prefs.js:31 +#: src/prefs.js:32 msgid "Middle" msgstr "Scrollwiel" -#: src/prefs.js:32 +#: src/prefs.js:33 msgid "Right" msgstr "Rechts" -#: src/prefs.js:33 +#: src/prefs.js:34 msgid "Button 4" msgstr "Knop 4" -#: src/prefs.js:34 +#: src/prefs.js:35 msgid "Button 5" msgstr "Knop 5" -#: src/prefs.js:35 +#: src/prefs.js:36 msgid "Button 6" msgstr "Knop 6" -#: src/prefs.js:36 +#: src/prefs.js:37 msgid "Button 7" msgstr "Knop 7" -#: src/prefs.js:37 +#: src/prefs.js:38 msgid "Button 8" msgstr "Knop 8" -#: src/prefs.js:38 +#: src/prefs.js:39 msgid "Button 9" msgstr "Knop 9" @@ -61,11 +61,19 @@ msgstr "Muisknop om vensters mee te sluiten" msgid "Which mouse button triggers closing in overview." msgstr "Met welke muisknop je vensters kunt sluiten op het overzicht." +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 +msgid "Close with keyboard" +msgstr "" + #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:23 +msgid "Allow closing windows in overview via keyboard shortcuts." +msgstr "" + +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:28 msgid "Rearrange delay" msgstr "Vertraging bij herschikken" -#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:24 +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:29 msgid "" "How much time must pass with the pointer not moving for windows in overview " "to rearrange after one was closed." diff --git a/extensions/46/middleclickclose/src/po/pt.po b/extensions/46/middleclickclose/src/po/pt.po index 7f35be1..1dd92d9 100644 --- a/extensions/46/middleclickclose/src/po/pt.po +++ b/extensions/46/middleclickclose/src/po/pt.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 23:56+0100\n" +"POT-Creation-Date: 2024-07-09 15:57+0300\n" "PO-Revision-Date: 2023-10-11 23:56+0100\n" "Last-Translator: Tomás Marques <tomasm576@gmail.com>\n" "Language-Team: \n" @@ -15,39 +15,39 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/prefs.js:30 +#: src/prefs.js:31 msgid "Left" msgstr "Esquerda" -#: src/prefs.js:31 +#: src/prefs.js:32 msgid "Middle" msgstr "Meio" -#: src/prefs.js:32 +#: src/prefs.js:33 msgid "Right" msgstr "Direita" -#: src/prefs.js:33 +#: src/prefs.js:34 msgid "Button 4" msgstr "Botão 4" -#: src/prefs.js:34 +#: src/prefs.js:35 msgid "Button 5" msgstr "Botão 5" -#: src/prefs.js:35 +#: src/prefs.js:36 msgid "Button 6" msgstr "Botão 6" -#: src/prefs.js:36 +#: src/prefs.js:37 msgid "Button 7" msgstr "Botão 7" -#: src/prefs.js:37 +#: src/prefs.js:38 msgid "Button 8" msgstr "Botão 8" -#: src/prefs.js:38 +#: src/prefs.js:39 msgid "Button 9" msgstr "Botão 9" @@ -59,14 +59,22 @@ msgstr "Botão do meio do rato" msgid "Which mouse button triggers closing in overview." msgstr "Qual o botão do rato que fecha uma janela na vista geral." +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 +msgid "Close with keyboard" +msgstr "" + #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:23 +msgid "Allow closing windows in overview via keyboard shortcuts." +msgstr "" + +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:28 msgid "Rearrange delay" msgstr "Duração de reorganizar" -#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:24 +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:29 msgid "" "How much time must pass with the pointer not moving for windows in overview " "to rearrange after one was closed." msgstr "" -"Quanto tempo tem de passar sem que o cursor se mova para que as janelas na visão geral " -"se reorganizem depois de uma ter sido fechada." +"Quanto tempo tem de passar sem que o cursor se mova para que as janelas na " +"visão geral se reorganizem depois de uma ter sido fechada." diff --git a/extensions/46/middleclickclose/src/po/sk.po b/extensions/46/middleclickclose/src/po/sk.po index d9c250a..c9e79a8 100644 --- a/extensions/46/middleclickclose/src/po/sk.po +++ b/extensions/46/middleclickclose/src/po/sk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-30 18:29+0300\n" +"POT-Creation-Date: 2024-07-09 15:57+0300\n" "PO-Revision-Date: 2015-10-30 07:08+0100\n" "Last-Translator: Juraj Fiala <doctorjellyface@riseup.net>\n" "Language-Team: \n" @@ -18,39 +18,39 @@ msgstr "" "X-Generator: Poedit 1.8.5\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -#: src/prefs.js:30 +#: src/prefs.js:31 msgid "Left" msgstr "Ľavé" -#: src/prefs.js:31 +#: src/prefs.js:32 msgid "Middle" msgstr "Stredné" -#: src/prefs.js:32 +#: src/prefs.js:33 msgid "Right" msgstr "Pravé" -#: src/prefs.js:33 +#: src/prefs.js:34 msgid "Button 4" msgstr "Tlačidlo 4" -#: src/prefs.js:34 +#: src/prefs.js:35 msgid "Button 5" msgstr "Tlačidlo 5" -#: src/prefs.js:35 +#: src/prefs.js:36 msgid "Button 6" msgstr "Tlačidlo 6" -#: src/prefs.js:36 +#: src/prefs.js:37 msgid "Button 7" msgstr "Tlačidlo 7" -#: src/prefs.js:37 +#: src/prefs.js:38 msgid "Button 8" msgstr "Tlačidlo 8" -#: src/prefs.js:38 +#: src/prefs.js:39 msgid "Button 9" msgstr "Tlačidlo 9" @@ -62,11 +62,19 @@ msgstr "Tlačidlo myši na zavretie" msgid "Which mouse button triggers closing in overview." msgstr "Ktoré tlačidlo myši spustí zavretie v prehľade aktivít." +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 +msgid "Close with keyboard" +msgstr "" + #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:23 +msgid "Allow closing windows in overview via keyboard shortcuts." +msgstr "" + +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:28 msgid "Rearrange delay" msgstr "Oneskorenie preskúpenia" -#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:24 +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:29 msgid "" "How much time must pass with the pointer not moving for windows in overview " "to rearrange after one was closed." diff --git a/extensions/46/middleclickclose/src/po/sr.po b/extensions/46/middleclickclose/src/po/sr.po index 514194c..037eb5c 100644 --- a/extensions/46/middleclickclose/src/po/sr.po +++ b/extensions/46/middleclickclose/src/po/sr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-02 18:28+0300\n" +"POT-Creation-Date: 2024-07-09 15:57+0300\n" "PO-Revision-Date: 2023-10-15 18:51+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -17,39 +17,39 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 3.4\n" -#: src/prefs.js:30 +#: src/prefs.js:31 msgid "Left" msgstr "Лево" -#: src/prefs.js:31 +#: src/prefs.js:32 msgid "Middle" msgstr "Средње" -#: src/prefs.js:32 +#: src/prefs.js:33 msgid "Right" msgstr "Десно" -#: src/prefs.js:33 +#: src/prefs.js:34 msgid "Button 4" msgstr "Дугме 4" -#: src/prefs.js:34 +#: src/prefs.js:35 msgid "Button 5" msgstr "Дугме 5" -#: src/prefs.js:35 +#: src/prefs.js:36 msgid "Button 6" msgstr "Дугме 6" -#: src/prefs.js:36 +#: src/prefs.js:37 msgid "Button 7" msgstr "Дугме 7" -#: src/prefs.js:37 +#: src/prefs.js:38 msgid "Button 8" msgstr "Дугме 8" -#: src/prefs.js:38 +#: src/prefs.js:39 msgid "Button 9" msgstr "Дугме 9" @@ -61,11 +61,19 @@ msgstr "Дугме на мишу за затварање апликација" msgid "Which mouse button triggers closing in overview." msgstr "Које дугме на мишу затвара апликацију у прегледнику." +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 +msgid "Close with keyboard" +msgstr "" + #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:23 +msgid "Allow closing windows in overview via keyboard shortcuts." +msgstr "" + +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:28 msgid "Rearrange delay" msgstr "Задршка у распоређивању" -#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:24 +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:29 msgid "" "How much time must pass with the pointer not moving for windows in overview " "to rearrange after one was closed." diff --git a/extensions/46/middleclickclose/src/po/sr@latin.po b/extensions/46/middleclickclose/src/po/sr@latin.po index 7ec468e..e6bc7f0 100644 --- a/extensions/46/middleclickclose/src/po/sr@latin.po +++ b/extensions/46/middleclickclose/src/po/sr@latin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-02 18:28+0300\n" +"POT-Creation-Date: 2024-07-09 15:57+0300\n" "PO-Revision-Date: 2023-10-15 18:52+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -17,39 +17,39 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 3.4\n" -#: src/prefs.js:30 +#: src/prefs.js:31 msgid "Left" msgstr "Levo" -#: src/prefs.js:31 +#: src/prefs.js:32 msgid "Middle" msgstr "Srednje" -#: src/prefs.js:32 +#: src/prefs.js:33 msgid "Right" msgstr "Desno" -#: src/prefs.js:33 +#: src/prefs.js:34 msgid "Button 4" msgstr "Dugme 4" -#: src/prefs.js:34 +#: src/prefs.js:35 msgid "Button 5" msgstr "Dugme 5" -#: src/prefs.js:35 +#: src/prefs.js:36 msgid "Button 6" msgstr "Dugme 6" -#: src/prefs.js:36 +#: src/prefs.js:37 msgid "Button 7" msgstr "Dugme 7" -#: src/prefs.js:37 +#: src/prefs.js:38 msgid "Button 8" msgstr "Dugme 8" -#: src/prefs.js:38 +#: src/prefs.js:39 msgid "Button 9" msgstr "Dugme 9" @@ -61,15 +61,23 @@ msgstr "Dugme na mišu za zatvaranje aplikacija" msgid "Which mouse button triggers closing in overview." msgstr "Koje dugme na mišu zatvara aplikaciju u pregledniku." +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 +msgid "Close with keyboard" +msgstr "" + #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:23 +msgid "Allow closing windows in overview via keyboard shortcuts." +msgstr "" + +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:28 msgid "Rearrange delay" msgstr "Zadrška u raspoređivanju" -#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:24 +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:29 msgid "" "How much time must pass with the pointer not moving for windows in overview " "to rearrange after one was closed." msgstr "" -"Koliko vremena mora da prođe prilikom nepomeranja pokazivača miša za " -"prozore aplikacija u pregledniku, kako bi se prozori rasporedili nakon " -"zatvaranja aplikacije." +"Koliko vremena mora da prođe prilikom nepomeranja pokazivača miša za prozore " +"aplikacija u pregledniku, kako bi se prozori rasporedili nakon zatvaranja " +"aplikacije." diff --git a/extensions/46/middleclickclose/src/po/template.pot b/extensions/46/middleclickclose/src/po/template.pot index 02cdf11..38cf0e2 100644 --- a/extensions/46/middleclickclose/src/po/template.pot +++ b/extensions/46/middleclickclose/src/po/template.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-02 18:28+0300\n" +"POT-Creation-Date: 2024-07-09 15:57+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -17,39 +17,39 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/prefs.js:30 +#: src/prefs.js:31 msgid "Left" msgstr "" -#: src/prefs.js:31 +#: src/prefs.js:32 msgid "Middle" msgstr "" -#: src/prefs.js:32 +#: src/prefs.js:33 msgid "Right" msgstr "" -#: src/prefs.js:33 +#: src/prefs.js:34 msgid "Button 4" msgstr "" -#: src/prefs.js:34 +#: src/prefs.js:35 msgid "Button 5" msgstr "" -#: src/prefs.js:35 +#: src/prefs.js:36 msgid "Button 6" msgstr "" -#: src/prefs.js:36 +#: src/prefs.js:37 msgid "Button 7" msgstr "" -#: src/prefs.js:37 +#: src/prefs.js:38 msgid "Button 8" msgstr "" -#: src/prefs.js:38 +#: src/prefs.js:39 msgid "Button 9" msgstr "" @@ -61,11 +61,19 @@ msgstr "" msgid "Which mouse button triggers closing in overview." msgstr "" +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 +msgid "Close with keyboard" +msgstr "" + #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:23 +msgid "Allow closing windows in overview via keyboard shortcuts." +msgstr "" + +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:28 msgid "Rearrange delay" msgstr "" -#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:24 +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:29 msgid "" "How much time must pass with the pointer not moving for windows in overview " "to rearrange after one was closed." diff --git a/extensions/46/middleclickclose/src/po/uk.po b/extensions/46/middleclickclose/src/po/uk.po index dedc32b..5224afc 100644 --- a/extensions/46/middleclickclose/src/po/uk.po +++ b/extensions/46/middleclickclose/src/po/uk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-22 00:00+0300\n" +"POT-Creation-Date: 2024-07-09 15:57+0300\n" "PO-Revision-Date: 2023-10-22 00:00+0300\n" "Last-Translator: Artem Prokop <artem.prokop.dev@gmail.com>\n" "Language-Team: \n" @@ -16,39 +16,39 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/prefs.js:30 +#: src/prefs.js:31 msgid "Left" msgstr "Ліва" -#: src/prefs.js:31 +#: src/prefs.js:32 msgid "Middle" msgstr "Середня" -#: src/prefs.js:32 +#: src/prefs.js:33 msgid "Right" msgstr "Права" -#: src/prefs.js:33 +#: src/prefs.js:34 msgid "Button 4" msgstr "Кнопка 4" -#: src/prefs.js:34 +#: src/prefs.js:35 msgid "Button 5" msgstr "Кнопка 5" -#: src/prefs.js:35 +#: src/prefs.js:36 msgid "Button 6" msgstr "Кнопка 6" -#: src/prefs.js:36 +#: src/prefs.js:37 msgid "Button 7" msgstr "Кнопка 7" -#: src/prefs.js:37 +#: src/prefs.js:38 msgid "Button 8" msgstr "Кнопка 8" -#: src/prefs.js:38 +#: src/prefs.js:39 msgid "Button 9" msgstr "Кнопка 9" @@ -60,14 +60,22 @@ msgstr "Кнопка миші для закриття" msgid "Which mouse button triggers closing in overview." msgstr "Яка кнопка миші закриває вікно в оверв'ю" +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 +msgid "Close with keyboard" +msgstr "" + #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:23 +msgid "Allow closing windows in overview via keyboard shortcuts." +msgstr "" + +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:28 msgid "Rearrange delay" msgstr "Затримка перерозташування" -#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:24 +#: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:29 msgid "" "How much time must pass with the pointer not moving for windows in overview " "to rearrange after one was closed." msgstr "" -"Скільки часу курсор має не рухатись щоб вікна в оверв'ю перерозташувалися" -" після закриття вікна." +"Скільки часу курсор має не рухатись щоб вікна в оверв'ю перерозташувалися " +"після закриття вікна." diff --git a/extensions/46/middleclickclose/src/prefs.js b/extensions/46/middleclickclose/src/prefs.js index 91d9f13..99d8858 100644 --- a/extensions/46/middleclickclose/src/prefs.js +++ b/extensions/46/middleclickclose/src/prefs.js @@ -18,7 +18,8 @@ import Gtk from 'gi://Gtk'; import GLib from 'gi://GLib'; import GObject from 'gi://GObject'; -import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; +import { ExtensionPreferences, gettext as _ } + from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; export default class MiddleClickClosePreferences extends ExtensionPreferences { getPreferencesWidget() { @@ -43,6 +44,8 @@ export default class MiddleClickClosePreferences extends ExtensionPreferences { step: 50, })); + group.add(this.buildPreference("keyboard-close")) + page.add(group); return page; } @@ -70,7 +73,7 @@ export default class MiddleClickClosePreferences extends ExtensionPreferences { }); row.connect('notify::selected', () => { - setting.activate(GLib.Variant.new_string(range[row.selected])); + setting.change_state(GLib.Variant.new_string(range[row.selected])); }); return row; @@ -79,7 +82,20 @@ export default class MiddleClickClosePreferences extends ExtensionPreferences { opts.upper ??= range[1] } - if (["i"].includes(ty)) { + if (ty == "b") { + let row = new Adw.SwitchRow({ + title: opts.title, + subtitle: opts.subtitle, + active: setting.state.unpack() + }); + + row.connect('notify::active', () => { + setting.change_state(GLib.Variant.new_boolean(row.active)); + }); + + return row; + + } else if (ty == "i") { let adjustment = new Gtk.Adjustment({ lower: opts.lower, upper: opts.upper, @@ -95,7 +111,7 @@ export default class MiddleClickClosePreferences extends ExtensionPreferences { }); adjustment.connect("value-changed", adj => { - setting.activate(GLib.Variant.new_int32(adj.value)); + setting.change_state(GLib.Variant.new_int32(adj.value)); }); return row; diff --git a/extensions/46/middleclickclose/src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml b/extensions/46/middleclickclose/src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml index ebe6dc9..93f3793 100644 --- a/extensions/46/middleclickclose/src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml +++ b/extensions/46/middleclickclose/src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml @@ -17,6 +17,11 @@ <summary>Mouse button to close</summary> <description>Which mouse button triggers closing in overview.</description> </key> + <key type="b" name="keyboard-close"> + <default>true</default> + <summary>Close with keyboard</summary> + <description>Allow closing windows in overview via keyboard shortcuts.</description> + </key> <key type="i" name="rearrange-delay"> <default>750</default> <range min="0" max="5000" /> |