From cc2f46b8370b35d2daf91c8d6d154b7b8808a8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 14 May 2021 17:00:35 +0200 Subject: [PATCH 01/16] Post-release version bump --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 91cb683c..759ee87a 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gnome-shell-extensions', - version: '40.1', + version: '40.2', meson_version: '>= 0.44.0', license: 'GPL2+' ) From 96a1de92db697d92e59822a74a7f5f550136d672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 20 May 2021 19:05:16 +0200 Subject: [PATCH 02/16] build: Only use major version in shell-versions The website changed its version handling again, and now takes "40.0" to mean "40.0, and only 40.0". Not complaining though, as "40" is more correct in my opinion anyway ... Part-of: --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 759ee87a..413645f9 100644 --- a/meson.build +++ b/meson.build @@ -22,7 +22,7 @@ sessiondir = join_paths(datadir, 'gnome-session', 'sessions') xsessiondir = join_paths(datadir, 'xsessions') ver_arr = meson.project_version().split('.') -shell_version = '@0@.0'.format(ver_arr[0]) +shell_version = ver_arr[0] uuid_suffix = '@gnome-shell-extensions.gcampax.github.com' From 08d382faccd9cf806522586ab904a9e47b5b2c74 Mon Sep 17 00:00:00 2001 From: Hugo Carvalho Date: Wed, 2 Jun 2021 16:09:54 +0000 Subject: [PATCH 03/16] Update Portuguese translation --- po/pt.po | 66 +++++++++++++++++++++++--------------------------------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/po/pt.po b/po/pt.po index c1e8ad94..a6546fbf 100644 --- a/po/pt.po +++ b/po/pt.po @@ -6,38 +6,39 @@ # António Lima , 2013. # Pedro Albuquerque , 2014. # Bruno Ramalhete , 2015. -# José Vieira , 2020. +# José Vieira , 2020-2021. +# Hugo Carvalho , 2021. # msgid "" msgstr "" "Project-Id-Version: 3.14\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/" "issues\n" -"POT-Creation-Date: 2020-05-28 00:55+0000\n" -"PO-Revision-Date: 2020-09-05 00:47+0100\n" -"Last-Translator: José Vieira \n" -"Language-Team: Portuguese <>\n" +"POT-Creation-Date: 2021-05-14 16:21+0000\n" +"PO-Revision-Date: 2021-06-02 17:07+0100\n" +"Last-Translator: Hugo Carvalho \n" +"Language-Team: Português <@>\n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" -"X-Generator: Gtranslator 3.36.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.4.3\n" "X-Project-Style: gnome\n" -#: data/gnome-classic.desktop.in:3 data/gnome-classic.session.desktop.in:3 +#: data/gnome-classic.desktop.in:3 msgid "GNOME Classic" msgstr "GNOME clássico" #: data/gnome-classic.desktop.in:4 msgid "This session logs you into GNOME Classic" -msgstr "Esta sessão entra no GNOME clássico" +msgstr "Esta sessão vai usar o GNOME clássico" #: extensions/apps-menu/extension.js:113 msgid "Favorites" msgstr "Favoritos" -#: extensions/apps-menu/extension.js:369 +#: extensions/apps-menu/extension.js:367 msgid "Applications" msgstr "Aplicações" @@ -54,11 +55,10 @@ msgstr "" "ficheiro desktop), seguido de dois pontos e o número da área de trabalho" #: extensions/auto-move-windows/prefs.js:35 -#| msgid "Workspace Names" msgid "Workspace Rules" msgstr "Regras das áreas de trabalho" -#: extensions/auto-move-windows/prefs.js:243 +#: extensions/auto-move-windows/prefs.js:237 msgid "Add Rule" msgstr "Adicionar regra" @@ -66,7 +66,6 @@ msgstr "Adicionar regra" #: extensions/drive-menu/extension.js:112 #: extensions/places-menu/placeDisplay.js:233 #, javascript-format -#| msgid "Ejecting drive '%s' failed:" msgid "Ejecting drive “%s” failed:" msgstr "Falha ao ejetar a unidade '%s':" @@ -74,8 +73,7 @@ msgstr "Falha ao ejetar a unidade '%s':" msgid "Removable devices" msgstr "Dispositivos removíveis" -#: extensions/drive-menu/extension.js:155 -#| msgid "Open File" +#: extensions/drive-menu/extension.js:152 msgid "Open Files" msgstr "Ficheiros abertos" @@ -96,7 +94,7 @@ msgstr "" #: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:11 msgid "Place window captions on top" -msgstr "Colocar título de janelas em cima" +msgstr "Colocar título de janela em cima" #: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:12 msgid "" @@ -104,18 +102,17 @@ msgid "" "shell default of placing it at the bottom. Changing this setting requires " "restarting the shell to have any effect." msgstr "" -"Se verdadeiro, coloca títulos de janelas em cima da respectiva miniatura, " +"Se verdadeiro, coloca títulos de janelas em cima das respectivas miniaturas, " "substituindo a predefinição, que as coloca no fundo. Alterar esta " "configuração requer reinicializar a interface para ter efeito." #: extensions/places-menu/extension.js:89 -#: extensions/places-menu/extension.js:93 +#: extensions/places-menu/extension.js:92 msgid "Places" msgstr "Locais" #: extensions/places-menu/placeDisplay.js:46 #, javascript-format -#| msgid "Failed to launch \"%s\"" msgid "Failed to launch “%s”" msgstr "Falha ao iniciar \"%s\"" @@ -142,7 +139,6 @@ msgid "Cycle Screenshot Sizes" msgstr "Percorrer os tamanhos de captura de ecrã" #: extensions/screenshot-window-sizer/org.gnome.shell.extensions.screenshot-window-sizer.gschema.xml:11 -#| msgid "Cycle Screenshot Sizes" msgid "Cycle Screenshot Sizes Backward" msgstr "Percorrer para trás os tamanhos de captura de ecrã" @@ -174,27 +170,27 @@ msgstr "Desmaximizar" msgid "Maximize" msgstr "Maximizar" -#: extensions/window-list/extension.js:428 +#: extensions/window-list/extension.js:432 msgid "Minimize all" msgstr "Minimizar todas" -#: extensions/window-list/extension.js:434 +#: extensions/window-list/extension.js:438 msgid "Unminimize all" msgstr "Desminimizar todas" -#: extensions/window-list/extension.js:440 +#: extensions/window-list/extension.js:444 msgid "Maximize all" msgstr "Maximizar todas" -#: extensions/window-list/extension.js:448 +#: extensions/window-list/extension.js:452 msgid "Unmaximize all" msgstr "Desmaximizar todas" -#: extensions/window-list/extension.js:456 +#: extensions/window-list/extension.js:460 msgid "Close all" msgstr "Fechar todas" -#: extensions/window-list/extension.js:734 +#: extensions/window-list/extension.js:737 msgid "Window List" msgstr "Lista de janelas" @@ -203,26 +199,19 @@ msgid "When to group windows" msgstr "Quando agrupar janelas" #: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:13 -#| msgid "" -#| "Decides when to group windows from the same application on the window " -#| "list. Possible values are \"never\", \"auto\" and \"always\"." msgid "" "Decides when to group windows from the same application on the window list. " "Possible values are “never”, “auto” and “always”." msgstr "" -"Decide quando agrupar janelas da mesma aplicação na lista de janelas. " -"Valores válidos são \"nunca\", \"auto\" e \"sempre\"." +"Decide quando agrupar janelas da mesma aplicação na lista de janelas. Os " +"valores válidos são \"nunca\", \"auto\" e \"sempre\"." #: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:20 #: extensions/window-list/prefs.js:100 -#| msgid "Show only windows in the current workspace" msgid "Show windows from all workspaces" msgstr "Mostrar janelas de todas as área de trabalho" #: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:21 -#| msgid "" -#| "Whether to show the window list on all connected monitors or only on the " -#| "primary one." msgid "Whether to show windows from all workspaces or only the current one." msgstr "" "Se deve mostrar janelas de todas as áreas de trabalho ou apenas da atual." @@ -259,8 +248,8 @@ msgstr "Agrupar sempre as janelas" msgid "Show on all monitors" msgstr "Mostrar em todos os monitores" -#: extensions/window-list/workspaceIndicator.js:207 -#: extensions/workspace-indicator/extension.js:213 +#: extensions/window-list/workspaceIndicator.js:249 +#: extensions/workspace-indicator/extension.js:255 msgid "Workspace Indicator" msgstr "Indicador de área de trabalho" @@ -273,8 +262,7 @@ msgstr "Nomes das áreas de trabalho" msgid "Workspace %d" msgstr "Área de trabalho %d" -#: extensions/workspace-indicator/prefs.js:218 -#| msgid "Workspace" +#: extensions/workspace-indicator/prefs.js:208 msgid "Add Workspace" msgstr "Adicionar área de trabalho" From 12eedcf6f729684100c1158670b404cf6ed7659c Mon Sep 17 00:00:00 2001 From: Juliano de Souza Camargo Date: Mon, 7 Jun 2021 10:22:02 +0000 Subject: [PATCH 04/16] Update Portuguese translation --- po/pt.po | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/po/pt.po b/po/pt.po index a6546fbf..87270e01 100644 --- a/po/pt.po +++ b/po/pt.po @@ -8,23 +8,29 @@ # Bruno Ramalhete , 2015. # José Vieira , 2020-2021. # Hugo Carvalho , 2021. +# Juliano de Souza Camargo , 2021. # msgid "" msgstr "" "Project-Id-Version: 3.14\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/" "issues\n" -"POT-Creation-Date: 2021-05-14 16:21+0000\n" -"PO-Revision-Date: 2021-06-02 17:07+0100\n" -"Last-Translator: Hugo Carvalho \n" -"Language-Team: Português <@>\n" +"POT-Creation-Date: 2021-06-02 16:10+0000\n" +"PO-Revision-Date: 2021-06-07 07:21-0300\n" +"Last-Translator: Juliano de Souza Camargo \n" +"Language-Team: Portuguese < >\n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.4.3\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"X-Generator: Gtranslator 40.0\n" "X-Project-Style: gnome\n" +"X-DL-Team: pt\n" +"X-DL-Module: gnome-shell-extensions\n" +"X-DL-Branch: gnome-40\n" +"X-DL-Domain: po\n" +"X-DL-State: Translating\n" #: data/gnome-classic.desktop.in:3 msgid "GNOME Classic" @@ -75,7 +81,7 @@ msgstr "Dispositivos removíveis" #: extensions/drive-menu/extension.js:152 msgid "Open Files" -msgstr "Ficheiros abertos" +msgstr "Abrir ficheiros" #: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:5 msgid "Use more screen for windows" From 3bb0897bc1b90bf522b77a225c7eeb419fbb9926 Mon Sep 17 00:00:00 2001 From: Adam Goode Date: Sat, 8 May 2021 11:49:56 -0400 Subject: [PATCH 05/16] window-list: Don't use panel-button class for the workspace indicator The panel-button introduces some horizontal padding which is insensitive to scroll events. Without this change, there is a small dead zone in the corner that cannot be used to switch workspaces with the mouse wheel. For useMenu mode, this has the effect of removing all of the horizontal space to the edge of the screen, so I add some back with the status-label-bin margin. This a is similar change to 8bad8a3b63d8719163dd0fb7fc9b2fd67969931c. Fixes #315. Part-of: (cherry picked from commit d6648b0b5c2a27c5ffaf2dcd353afacf3e8dd538) --- extensions/window-list/stylesheet.css | 2 +- extensions/window-list/workspaceIndicator.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/window-list/stylesheet.css b/extensions/window-list/stylesheet.css index 38ea9d86..87813a42 100644 --- a/extensions/window-list/stylesheet.css +++ b/extensions/window-list/stylesheet.css @@ -82,7 +82,7 @@ background-color: rgba(200, 200, 200, .3); border: 1px solid #cccccc; padding: 0 3px; - margin: 3px 0; + margin: 3px; } .window-list-workspace-indicator .workspaces-box { diff --git a/extensions/window-list/workspaceIndicator.js b/extensions/window-list/workspaceIndicator.js index 41eedf63..c35e37a7 100644 --- a/extensions/window-list/workspaceIndicator.js +++ b/extensions/window-list/workspaceIndicator.js @@ -249,6 +249,7 @@ class WorkspaceIndicator extends PanelMenu.Button { super._init(0.0, _('Workspace Indicator'), true); this.setMenu(new PopupMenu.PopupMenu(this, 0.0, St.Side.BOTTOM)); this.add_style_class_name('window-list-workspace-indicator'); + this.remove_style_class_name('panel-button'); this.menu.actor.remove_style_class_name('panel-menu'); let container = new St.Widget({ From 4286fd1bcc5cb94b5f022a04526377f754074510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 10 Jun 2021 13:41:34 +0200 Subject: [PATCH 06/16] Tag release 40.2 Update NEWS. --- NEWS | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NEWS b/NEWS index e7420445..a6ea6610 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +40.2 +==== +* window-list: Extend reactive area of minimap to screen edges [Adam; !171] +* Misc. bug fixes [Florian; !172] + +Contributors: + Adam Goode, Florian Müllner + +Translators: + Hugo Carvalho [pt], Juliano de Souza Camargo [pt] + 40.1 ==== * Disable welcome dialog in classic session [Florian; !169] From 561b8aeb03493b5c0813f52b285898ebae648462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 5 Feb 2018 22:16:09 +0100 Subject: [PATCH 07/16] drive-menu: Don't assume mounts without volume are local The intention of the code is to only expose actually plugged in devices rather than network mounts, but the existing heuristics are based on GVolume and simply assume a local mount where there's no associated volume. Fill that gap by querying the ::remote filesystem attribute in that case. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/53 Part-of: (cherry picked from commit 7d6670ce3c1716bdaf2cba7e7fa942cceff4cc31) --- extensions/drive-menu/extension.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index 5bd91522..59603c80 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -62,13 +62,21 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem { let volume = this.mount.get_volume(); - if (!volume) { - // probably a GDaemonMount, could be network or - // local, but we can't tell; assume it's local for now - return true; + if (volume) + return volume.get_identifier('class') !== 'network'; + + const root = this.mount.get_root(); + + try { + const attr = Gio.FILE_ATTRIBUTE_FILESYSTEM_REMOTE; + const info = root.query_filesystem_info(attr, null); + return !info.get_attribute_boolean(attr); + } catch (e) { + log(`Failed to query filesystem: ${e.message}`); } - return volume.get_identifier('class') !== 'network'; + // Hack, fall back to looking at GType + return Gio._LocalFilePrototype.isPrototypeOf(root); } _syncVisibility() { From 619de9d5ee0659884656ffc4dd8f507d002aa451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 23 Jun 2021 17:58:39 +0200 Subject: [PATCH 08/16] drive-menu: Avoid blocking I/O when querying filesystem The last commit improved the heuristics for detecting network mounts, but at the price of potentially blocking the shell. Avoid that drawback by making the code in question async. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/53 Part-of: (cherry picked from commit 519269be9d849551631b36564e3fb83ae5129099) --- extensions/drive-menu/extension.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index 59603c80..3fac2360 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -54,7 +54,21 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem { super.destroy(); } - _isInteresting() { + _fsIsRemote(root) { + return new Promise((resolve, reject) => { + const attr = Gio.FILE_ATTRIBUTE_FILESYSTEM_REMOTE; + root.query_filesystem_info_async(attr, null, (o, res) => { + try { + const info = root.query_filesystem_info_finish(res); + resolve(!info.get_attribute_boolean(attr)); + } catch (e) { + reject(e); + } + }); + }); + } + + async _isInteresting() { if (!this.mount.can_eject() && !this.mount.can_unmount()) return false; if (this.mount.is_shadowed()) @@ -68,9 +82,7 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem { const root = this.mount.get_root(); try { - const attr = Gio.FILE_ATTRIBUTE_FILESYSTEM_REMOTE; - const info = root.query_filesystem_info(attr, null); - return !info.get_attribute_boolean(attr); + return await this._fsIsRemote(root); } catch (e) { log(`Failed to query filesystem: ${e.message}`); } @@ -79,8 +91,8 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem { return Gio._LocalFilePrototype.isPrototypeOf(root); } - _syncVisibility() { - this.visible = this._isInteresting(); + async _syncVisibility() { + this.visible = await this._isInteresting(); } _eject() { From 28dbb47937f0177a21ecee6c18de11a68dde0bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jun 2021 17:57:57 +0200 Subject: [PATCH 09/16] window-list: Init translations Whoops, we are missing the bindtextdomain() call, which means translations won't work when no other extension that shares the same domain is used (like in GNOME Classic for instance). https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/340 (cherry picked from commit c9d7f99d50f96d29c38380d9f0e3c9ddc660db9f) --- extensions/window-list/extension.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index acb5c639..4802f9e9 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -1105,6 +1105,8 @@ class WindowList extends St.Widget { class Extension { constructor() { + ExtensionUtils.initTranslations(); + this._windowLists = null; this._hideOverviewOrig = Main.overview.hide; } From 5e316d37cb30dd647d3737ecd1dbe87049dafca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 12 Jul 2021 18:18:45 +0200 Subject: [PATCH 10/16] Bump version to 40.3 Update NEWS. --- NEWS | 8 ++++++++ meson.build | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a6ea6610..564742ee 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +40.3 +==== +* drive-menu: Improve detection of network mounts [Florian; !27] +* Misc. bug fixes [Florian; #340] + +Contributors: + Florian Müllner + 40.2 ==== * window-list: Extend reactive area of minimap to screen edges [Adam; !171] diff --git a/meson.build b/meson.build index 413645f9..7bd8116a 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gnome-shell-extensions', - version: '40.2', + version: '40.3', meson_version: '>= 0.44.0', license: 'GPL2+' ) From cc021589b848077811b592bbe2d23a60525a85bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 13 Jul 2021 11:40:31 +0200 Subject: [PATCH 11/16] drive-menu: Fix indicator visibility Commit 519269be9d made the check for network mounts non-blocking, and we now update the indicator's visibility before a newly-added network mount is hidden. Address this by monitoring the item itself for visibility changes. Part-of: --- extensions/drive-menu/extension.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index 3fac2360..6c6fd763 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -189,6 +189,8 @@ class DriveMenu extends PanelMenu.Button { let item = new MountMenuItem(mount); this._mounts.unshift(item); this.menu.addMenuItem(item, 0); + + item.connect('notify::visible', () => this._updateMenuVisibility()); } _removeMount(mount) { From 15c83db79379532b72df1989463fc102a90fdfc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 13 Jul 2021 11:54:21 +0200 Subject: [PATCH 12/16] drive-menu: Hide items initially Now that the check for network mounts is non-blocking, the initial sync doesn't take effect immediately. We don't want hidden items to briefly flash the indicator, so create them initially hidden. Part-of: --- extensions/drive-menu/extension.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index 6c6fd763..f60dab75 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -41,6 +41,8 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem { ejectButton.connect('clicked', this._eject.bind(this)); this.add(ejectButton); + this.hide(); + this._changedId = mount.connect('changed', this._syncVisibility.bind(this)); this._syncVisibility(); } @@ -155,10 +157,8 @@ class DriveMenu extends PanelMenu.Button { this.add_child(icon); this._monitor = Gio.VolumeMonitor.get(); - this._addedId = this._monitor.connect('mount-added', (monitor, mount) => { - this._addMount(mount); - this._updateMenuVisibility(); - }); + this._addedId = this._monitor.connect('mount-added', + (monitor, mount) => this._addMount(mount)); this._removedId = this._monitor.connect('mount-removed', (monitor, mount) => { this._removeMount(mount); this._updateMenuVisibility(); From 1d3775b3d10f28b02c4fca55f94ab1fca9161946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 6 Aug 2021 04:17:46 +0200 Subject: [PATCH 13/16] extensions: Pick up gettext domain from metadata Since commit a6ee142f211, the extension archives that are uploaded to extensions.gnome.org only contain strings that are relevant for the extension, not all translations from all extensions. Unfortunately all extensions still share a common gettext domain, so the extension with the last bind_textdomain() call wins and leaves the others without translations. We'll address this by using distinct domains when not installed system-wide. That becomes easier if there is a canonical place for the text domain, with the existing metadata key being the natural choice. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/335 Part-of: --- extensions/.lock | 0 extensions/apps-menu/extension.js | 3 ++- extensions/auto-move-windows/prefs.js | 7 ++++--- extensions/drive-menu/extension.js | 7 ++++--- extensions/places-menu/extension.js | 5 +++-- extensions/places-menu/placeDisplay.js | 5 ++++- extensions/window-list/extension.js | 2 +- extensions/window-list/prefs.js | 7 ++++--- extensions/window-list/workspaceIndicator.js | 5 ++++- extensions/workspace-indicator/extension.js | 4 +++- extensions/workspace-indicator/prefs.js | 7 ++++--- 11 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 extensions/.lock diff --git a/extensions/.lock b/extensions/.lock new file mode 100644 index 00000000..e69de29b diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 6376b524..e36b0fe6 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -12,7 +12,8 @@ const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; -const Gettext = imports.gettext.domain('gnome-shell-extensions'); +const Me = ExtensionUtils.getCurrentExtension(); +const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']); const _ = Gettext.gettext; const appSys = Shell.AppSystem.get_default(); diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index c5504584..2c529067 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -4,10 +4,11 @@ const { Gio, GLib, GObject, Gtk, Pango } = imports.gi; -const Gettext = imports.gettext.domain('gnome-shell-extensions'); -const _ = Gettext.gettext; - const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']); +const _ = Gettext.gettext; const SETTINGS_KEY = 'application-list'; diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index f60dab75..fd3a9214 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -2,15 +2,16 @@ // Drive menu extension const { Clutter, Gio, GObject, Shell, St } = imports.gi; -const Gettext = imports.gettext.domain('gnome-shell-extensions'); -const _ = Gettext.gettext; - const ExtensionUtils = imports.misc.extensionUtils; const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; const ShellMountOperation = imports.ui.shellMountOperation; +const Me = ExtensionUtils.getCurrentExtension(); +const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']); +const _ = Gettext.gettext; + var MountMenuItem = GObject.registerClass( class MountMenuItem extends PopupMenu.PopupBaseMenuItem { _init(mount) { diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index 53663fc7..e3b04d6d 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -8,11 +8,12 @@ const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; -const Gettext = imports.gettext.domain('gnome-shell-extensions'); +const Me = ExtensionUtils.getCurrentExtension(); + +const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']); const _ = Gettext.gettext; const N_ = x => x; -const Me = ExtensionUtils.getCurrentExtension(); const PlaceDisplay = Me.imports.placeDisplay; const PLACE_ICON_SIZE = 16; diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index bb78d5ec..d2afc1ea 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -3,10 +3,13 @@ const { Gio, GLib, Shell } = imports.gi; const Signals = imports.signals; +const ExtensionUtils = imports.misc.extensionUtils; const Main = imports.ui.main; const ShellMountOperation = imports.ui.shellMountOperation; -const Gettext = imports.gettext.domain('gnome-shell-extensions'); +const Me = ExtensionUtils.getCurrentExtension(); + +const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']); const _ = Gettext.gettext; const N_ = x => x; diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 4802f9e9..f7ecd190 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -11,7 +11,7 @@ const Me = ExtensionUtils.getCurrentExtension(); const { WindowPicker, WindowPickerToggle } = Me.imports.windowPicker; const { WorkspaceIndicator } = Me.imports.workspaceIndicator; -const Gettext = imports.gettext.domain('gnome-shell-extensions'); +const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']); const _ = Gettext.gettext; const ICON_TEXTURE_SIZE = 24; diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js index 217c2224..aec8cc9d 100644 --- a/extensions/window-list/prefs.js +++ b/extensions/window-list/prefs.js @@ -3,10 +3,11 @@ const { Gio, GObject, Gtk } = imports.gi; -const Gettext = imports.gettext.domain('gnome-shell-extensions'); -const _ = Gettext.gettext; - const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']); +const _ = Gettext.gettext; function init() { diff --git a/extensions/window-list/workspaceIndicator.js b/extensions/window-list/workspaceIndicator.js index c35e37a7..cdfe5b61 100644 --- a/extensions/window-list/workspaceIndicator.js +++ b/extensions/window-list/workspaceIndicator.js @@ -2,11 +2,14 @@ const { Clutter, Gio, GObject, Meta, St } = imports.gi; const DND = imports.ui.dnd; +const ExtensionUtils = imports.misc.extensionUtils; const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; -const Gettext = imports.gettext.domain('gnome-shell-extensions'); +const Me = ExtensionUtils.getCurrentExtension(); + +const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']); const _ = Gettext.gettext; const TOOLTIP_OFFSET = 6; diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index b79af930..6974062b 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -9,7 +9,9 @@ const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; -const Gettext = imports.gettext.domain('gnome-shell-extensions'); +const Me = ExtensionUtils.getCurrentExtension(); + +const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']); const _ = Gettext.gettext; const WORKSPACE_SCHEMA = 'org.gnome.desktop.wm.preferences'; diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index d45d1e81..567f3e99 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -3,12 +3,13 @@ const { Gio, GLib, GObject, Gtk, Pango } = imports.gi; -const Gettext = imports.gettext.domain('gnome-shell-extensions'); +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']); const _ = Gettext.gettext; const N_ = e => e; -const ExtensionUtils = imports.misc.extensionUtils; - const WORKSPACE_SCHEMA = 'org.gnome.desktop.wm.preferences'; const WORKSPACE_KEY = 'workspace-names'; From 1a1d45d9e4ee010d71bf958499442550e053d34e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 6 Aug 2021 04:20:47 +0200 Subject: [PATCH 14/16] build: Remove unused variable https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/335 Part-of: --- export-zips.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/export-zips.sh b/export-zips.sh index 6fa3b441..25680195 100755 --- a/export-zips.sh +++ b/export-zips.sh @@ -14,7 +14,6 @@ mkdir $srcdir/zip-files extensiondir=$installdir/share/gnome-shell/extensions schemadir=$installdir/share/glib-2.0/schemas -localedir=$installdir/share/locale for f in $extensiondir/*; do name=`basename ${f%%@*}` From 06acd9ff25dce3ab5224bf1ba6c481a40a984dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 6 Aug 2021 04:22:47 +0200 Subject: [PATCH 15/16] build: Rewrite gettext domain when exporting zips Now that every extension picks up its gettext domain from its metadata, we can easily change it when exporting the zips. That ensures that every extension only binds its own domain instead of messing up other extension's translations. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/335 Part-of: --- export-zips.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/export-zips.sh b/export-zips.sh index 25680195..30991449 100755 --- a/export-zips.sh +++ b/export-zips.sh @@ -20,6 +20,10 @@ for f in $extensiondir/*; do uuid=$name@gnome-shell-extensions.gcampax.github.com schema=$schemadir/org.gnome.shell.extensions.$name.gschema.xml + olddomain=gnome-shell-extensions + newdomain=gnome-shell-extension-$name + sed -i "/gettext-domain/ s:$olddomain:$newdomain:" $f/metadata.json + xgettext --from-code=UTF-8 --output-dir=$builddir --output=$name.pot $f/*.js if [ -f $builddir/$name.pot ]; then From a5a3523df8c5ff72ade2ecca1cf0ae33d100250d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 18 Aug 2021 01:18:19 +0200 Subject: [PATCH 16/16] Bump version to 40.4 Update NEWS. --- NEWS | 9 +++++++++ meson.build | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 564742ee..85f18abe 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +40.4 +==== +* drive-menu: Fix indicator visibility [Florian; !176] +* Use distinct gettext domain for e.g.o uploads [Florian; #335] + +Contributors: + Florian Müllner + + 40.3 ==== * drive-menu: Improve detection of network mounts [Florian; !27] diff --git a/meson.build b/meson.build index 7bd8116a..1ecdc71e 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gnome-shell-extensions', - version: '40.3', + version: '40.4', meson_version: '>= 0.44.0', license: 'GPL2+' )