From 3cf8c4a1c4576ec9f32ed8d5c79c6af100af8541 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 16 Sep 2024 19:01:27 +0200 Subject: Updating 46/middleclickclose to version 31 [2bac2aa]. Signed-off-by: Daniel Baumann --- extensions/46/middleclickclose/README.md | 42 ++++++---- extensions/46/middleclickclose/img/ego.svg | 22 ++++++ extensions/46/middleclickclose/src/extension.js | 91 ++++++++++++++++++++-- extensions/46/middleclickclose/src/metadata.json | 3 +- extensions/46/middleclickclose/src/po/de.po | 30 ++++--- extensions/46/middleclickclose/src/po/el.po | 40 ++++++---- extensions/46/middleclickclose/src/po/fr.po | 30 ++++--- extensions/46/middleclickclose/src/po/it.po | 30 ++++--- extensions/46/middleclickclose/src/po/nl.po | 30 ++++--- extensions/46/middleclickclose/src/po/pt.po | 34 ++++---- extensions/46/middleclickclose/src/po/sk.po | 30 ++++--- extensions/46/middleclickclose/src/po/sr.po | 30 ++++--- extensions/46/middleclickclose/src/po/sr@latin.po | 36 +++++---- extensions/46/middleclickclose/src/po/template.pot | 30 ++++--- extensions/46/middleclickclose/src/po/uk.po | 34 ++++---- extensions/46/middleclickclose/src/prefs.js | 24 +++++- ...e.shell.extensions.middleclickclose.gschema.xml | 5 ++ 17 files changed, 382 insertions(+), 159 deletions(-) create mode 100644 extensions/46/middleclickclose/img/ego.svg (limited to 'extensions/46/middleclickclose') diff --git a/extensions/46/middleclickclose/README.md b/extensions/46/middleclickclose/README.md index bfb193b..adcf2f9 100644 --- a/extensions/46/middleclickclose/README.md +++ b/extensions/46/middleclickclose/README.md @@ -1,24 +1,34 @@ Quick Close in Overview -================ +----------------------- +GNOME shell extension for quickly closing apps in the overview. -Gnome shell extension for closing apps in overview with a middle (or other) click. +[![Download from extensions.gnome.org](img/ego.svg)](https://extensions.gnome.org/extension/352/middle-click-to-close-in-overview/) -All credit goes to Paolo Tranquilli (http://cs.unibo.it/~tranquil/en/hacking.html), I've merely -copied its code here to provide Gnome Shell 3.10+ compatibility +## Features -This extension is installable from -https://extensions.gnome.org/extension/352/middle-click-to-close-in-overview/. +- **Middle click to close**: Just hover over the app you want to close in the overview, and middle + click. The mouse button that will trigger closing can be adjusted in the settings. +- **`Alt+F4` in the overview**: When triggering the close action (typically `Alt+F4`), the focused + window will be closed. This can be turned off in the settings. +- **Adjustable rearrange delay**: After closing an application, GNOME will wait a bit before + rearranging the remaining windows. This extension allows configuring that delay. -Otherwise you may +## Building -* download a [zip](https://github.com/p91paul/middleclickclose/archive/master.zip) of this extension -* extract it -* run the following command - ``` - make install -``` -* reload gnome-shell (Alt-F2, r, Enter) -> on Wayland you need to log out and log in again, there is no in-place reload -* activate it through the Gnome Extensions application. +Make sure `gettext` is installed on your system and the `gnome-extensions` executable is available +on your `PATH` (It is typically bundled with `gnome-shell`). + +Afterwards, simply run `make` to build a zip suitable for submition to +[EGO](https://extensions.gnome.org/). + +`make install` can also be used to install the extension for the current user. + +## Debugging tips & tricks + +- `journalctl -f --user` is your friend. +- `make install && dbus-run-session -- gnome-shell --nested --wayland` allows for quick prototyping + without having to log out and back in every single time when running under wayland. +- `make install`, then `Alt+F2`, `r` and `Enter` allow for quick prototyping under X11. ## Translations @@ -26,4 +36,4 @@ If you're interested in contributing a translation, import the translation templ `src/po/template.pot` to your favourite po-editing software and create a `*.po` file under `src/po`. To update all existing translations after changing the code, run `make po`. To regenerate only the -`template.pot` file, run `make pot` +`template.pot` file, run `make pot`. diff --git a/extensions/46/middleclickclose/img/ego.svg b/extensions/46/middleclickclose/img/ego.svg new file mode 100644 index 0000000..ae750fa --- /dev/null +++ b/extensions/46/middleclickclose/img/ego.svg @@ -0,0 +1,22 @@ + + Download From EGO + + + + + + + + + + + + + + + + + + + + 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 \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 \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 \n" "Language-Team: Jimmy Scionti \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 \n" "Language-Team: Dutch \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 \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 \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 \n" "Language-Team: LANGUAGE \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 \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 @@ Mouse button to close Which mouse button triggers closing in overview. + + true + Close with keyboard + Allow closing windows in overview via keyboard shortcuts. + 750 -- cgit v1.2.3