From c86a67823c501406a1f43db0c2b8d39f4af04d5b Mon Sep 17 00:00:00 2001 From: Xavi Ivars Date: Thu, 5 Oct 2017 14:01:50 +0200 Subject: [PATCH 01/60] [l10n] Updated Catalan (Valencian) translation --- po/ca@valencia.po | 236 ++++++++++++++++++++++++++-------------------- 1 file changed, 134 insertions(+), 102 deletions(-) diff --git a/po/ca@valencia.po b/po/ca@valencia.po index ef2b3d7e..42598bc3 100644 --- a/po/ca@valencia.po +++ b/po/ca@valencia.po @@ -7,50 +7,45 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-08-17 14:40+0200\n" -"PO-Revision-Date: 2014-08-17 14:38+0200\n" -"Last-Translator: Gil Forcada \n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" +"shell&keywords=I18N+L10N&component=extensions\n" +"POT-Creation-Date: 2017-09-08 06:09+0000\n" +"PO-Revision-Date: 2017-07-08 13:29+0100\n" +"Last-Translator: Xavi Ivars \n" "Language-Team: Catalan \n" -"Language: ca@valencia\n" +"Language: ca-valencia\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bits\n" +"Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -#: ../data/gnome-classic.desktop.in.h:1 -#: ../data/gnome-classic.session.desktop.in.in.h:1 +#: data/gnome-classic.desktop.in:3 data/gnome-classic.session.desktop.in:3 msgid "GNOME Classic" msgstr "GNOME clàssic" -#: ../data/gnome-classic.desktop.in.h:2 +#: data/gnome-classic.desktop.in:4 msgid "This session logs you into GNOME Classic" msgstr "Esta sessió vos permet utilitzar el GNOME clàssic" -#: ../data/gnome-shell-classic.desktop.in.in.h:1 -msgid "GNOME Shell Classic" -msgstr "GNOME Shell clàssic" - -#: ../data/gnome-shell-classic.desktop.in.in.h:2 -msgid "Window management and application launching" -msgstr "Gestió de finestres i iniciació d'aplicacions" - -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:1 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:7 msgid "Attach modal dialog to the parent window" msgstr "Adjunta el diàleg modal a la finestra pare" -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:2 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:8 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:25 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:33 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:41 msgid "" "This key overrides the key in org.gnome.mutter when running GNOME Shell." msgstr "" "Si s'executa el GNOME Shell, esta clau sobreescriu la clau «org.gnome." "mutter»." -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:3 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:16 msgid "Arrangement of buttons on the titlebar" -msgstr "Disposició dels botons en la barra de títol" +msgstr "Disposició dels botons en la barra de títol" -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:4 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:17 msgid "" "This key overrides the key in org.gnome.desktop.wm.preferences when running " "GNOME Shell." @@ -58,58 +53,58 @@ msgstr "" "Si s'executa el GNOME Shell, esta clau sobreescriu la clau «org.gnome." "desktop.wm.preferences»." -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:5 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:24 msgid "Enable edge tiling when dropping windows on screen edges" msgstr "" -"Habilita la tesselització a les vores en deixar anar les finestres a les " +"Habilita la tessel·lització a les vores en deixar anar les finestres a les " "vores de la pantalla" -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:6 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:32 msgid "Workspaces only on primary monitor" msgstr "Els espais de treball només es mostren en el monitor principal" -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:7 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:40 msgid "Delay focus changes in mouse mode until the pointer stops moving" msgstr "" "Retarda el canvi de focus, en mode ratolí, fins que el punter estiga quiet" -#: ../extensions/alternate-tab/prefs.js:20 +#: extensions/alternate-tab/prefs.js:20 msgid "Thumbnail only" msgstr "Només miniatures" -#: ../extensions/alternate-tab/prefs.js:21 +#: extensions/alternate-tab/prefs.js:21 msgid "Application icon only" msgstr "Només la icona de l'aplicació" -#: ../extensions/alternate-tab/prefs.js:22 +#: extensions/alternate-tab/prefs.js:22 msgid "Thumbnail and application icon" msgstr "Miniatura i icona de l'aplicació" -#: ../extensions/alternate-tab/prefs.js:38 +#: extensions/alternate-tab/prefs.js:38 msgid "Present windows as" msgstr "Mostra les finestres com a" -#: ../extensions/alternate-tab/prefs.js:69 +#: extensions/alternate-tab/prefs.js:69 msgid "Show only windows in the current workspace" msgstr "Mostra només les icones de l'espai de treball actual" -#: ../extensions/apps-menu/extension.js:39 +#: extensions/apps-menu/extension.js:41 msgid "Activities Overview" msgstr "Vista general d'activitats" -#: ../extensions/apps-menu/extension.js:113 +#: extensions/apps-menu/extension.js:141 msgid "Favorites" msgstr "Preferides" -#: ../extensions/apps-menu/extension.js:282 +#: extensions/apps-menu/extension.js:436 msgid "Applications" msgstr "Aplicacions" -#: ../extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml.in.h:1 +#: extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml:6 msgid "Application and workspace list" msgstr "Aplicació i llista d'espais de treball" -#: ../extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml.in.h:2 +#: extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml:7 msgid "" "A list of strings, each containing an application id (desktop file name), " "followed by a colon and the workspace number" @@ -118,90 +113,94 @@ msgstr "" "d'aplicació (nom del fitxer de l'escriptori), seguit de dos punts i el " "número de l'espai de treball" -#: ../extensions/auto-move-windows/prefs.js:60 +#: extensions/auto-move-windows/prefs.js:60 msgid "Application" msgstr "Aplicació" -#: ../extensions/auto-move-windows/prefs.js:69 -#: ../extensions/auto-move-windows/prefs.js:127 +#: extensions/auto-move-windows/prefs.js:69 +#: extensions/auto-move-windows/prefs.js:127 msgid "Workspace" msgstr "Espai de treball" -#: ../extensions/auto-move-windows/prefs.js:85 +#: extensions/auto-move-windows/prefs.js:85 msgid "Add Rule" msgstr "Afig una regla" -#: ../extensions/auto-move-windows/prefs.js:106 +#: extensions/auto-move-windows/prefs.js:106 msgid "Create new matching rule" msgstr "Crea una regla de coincidència nova" -#: ../extensions/auto-move-windows/prefs.js:111 +#: extensions/auto-move-windows/prefs.js:111 msgid "Add" msgstr "Afig" -#: ../extensions/drive-menu/extension.js:106 +#. TRANSLATORS: %s is the filesystem name +#: extensions/drive-menu/extension.js:107 #, javascript-format -msgid "Ejecting drive '%s' failed:" +msgid "Ejecting drive “%s” failed:" msgstr "Ha fallat l'expulsió de la unitat «%s»:" -#: ../extensions/drive-menu/extension.js:123 +#: extensions/drive-menu/extension.js:125 msgid "Removable devices" msgstr "Dispositius extraïbles" -#: ../extensions/drive-menu/extension.js:150 -msgid "Open File" -msgstr "Obri el fitxer" +#: extensions/drive-menu/extension.js:150 +msgid "Open Files" +msgstr "Obri els fitxers" -#: ../extensions/example/extension.js:17 +#: extensions/example/extension.js:17 msgid "Hello, world!" msgstr "Hola, món!" -#: ../extensions/example/org.gnome.shell.extensions.example.gschema.xml.in.h:1 +#: extensions/example/org.gnome.shell.extensions.example.gschema.xml:5 msgid "Alternative greeting text." msgstr "Text de rebuda alternatiu." -#: ../extensions/example/org.gnome.shell.extensions.example.gschema.xml.in.h:2 +#: extensions/example/org.gnome.shell.extensions.example.gschema.xml:6 msgid "" "If not empty, it contains the text that will be shown when clicking on the " "panel." msgstr "" "Si no és buit, conté el text que es mostrarà quan es faça clic en el quadre." -#: ../extensions/example/prefs.js:30 +#: extensions/example/prefs.js:30 msgid "Message" msgstr "Missatge" -#: ../extensions/example/prefs.js:43 +#. TRANSLATORS: Example is the name of the extension, should not be +#. translated +#: extensions/example/prefs.js:43 msgid "" "Example aims to show how to build well behaved extensions for the Shell and " "as such it has little functionality on its own.\n" -"Nevertheless it's possible to customize the greeting message." +"Nevertheless it’s possible to customize the greeting message." msgstr "" "L'«Example» està pensat com una extensió del GNOME Shell que demostri la " "manera correcta de crear extensions. Com a extensió pròpiament dita no fa " "gairebé res.\n" -"Tot i així permet personalitzar el missatge del rebedor." +"Tot i així permet personalitzar el missatge de benvinguda." -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:1 +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:5 msgid "Use more screen for windows" msgstr "Utilitza més pantalla per les finestres" -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:2 +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:6 msgid "" "Try to use more screen for placing window thumbnails by adapting to screen " "aspect ratio, and consolidating them further to reduce the bounding box. " "This setting applies only with the natural placement strategy." msgstr "" "Intenta utilitzar més espai de la pantalla per posicionar les miniatures de " -"les finestres adaptant-les al ràtio d'aspecte de la pantalla, consolidant-" -"les més per reduir la capsa que les envolta. Este paràmetre de configuració " -"només s'aplica a l'estratègia de posicionament de finestres natural." +"les finestres adaptant-les a la ràtio d'aspecte de la pantalla, consolidant-" +"les més per reduir la capsa que les envolta. Este paràmetre de " +"configuració només s'aplica a l'estratègia de posicionament de finestres " +"natural." -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:3 +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:11 msgid "Place window captions on top" msgstr "Posiciona els títols de les finestres al damunt" -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:4 +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:12 msgid "" "If true, place window captions on top the respective thumbnail, overriding " "shell default of placing it at the bottom. Changing this setting requires " @@ -209,135 +208,168 @@ msgid "" msgstr "" "Si és «true» (cert), posiciona el títol de la finestra damunt de la " "miniatura corresponent, substituint el comportament per defecte del Shell de " -"posicionar-lo a baix. Cal reiniciar el Shell per tal de que este canvi tinga " +"posicionar-lo a baix. Cal reiniciar el Shell per tal que este canvi tinga " "efecte." -#: ../extensions/places-menu/extension.js:78 -#: ../extensions/places-menu/extension.js:81 +#: extensions/places-menu/extension.js:78 +#: extensions/places-menu/extension.js:81 msgid "Places" msgstr "Llocs" -#: ../extensions/places-menu/placeDisplay.js:57 +#: extensions/places-menu/placeDisplay.js:65 #, javascript-format -msgid "Failed to launch \"%s\"" +msgid "Failed to mount volume for “%s”" +msgstr "No s'ha pogut muntar el volum «%s»" + +#: extensions/places-menu/placeDisplay.js:78 +#, javascript-format +msgid "Failed to launch “%s”" msgstr "No s'ha pogut iniciar «%s»" -#: ../extensions/places-menu/placeDisplay.js:99 -#: ../extensions/places-menu/placeDisplay.js:122 +#: extensions/places-menu/placeDisplay.js:137 +#: extensions/places-menu/placeDisplay.js:160 msgid "Computer" msgstr "Ordinador" -#: ../extensions/places-menu/placeDisplay.js:200 +#: extensions/places-menu/placeDisplay.js:303 msgid "Home" msgstr "Inici" -#: ../extensions/places-menu/placeDisplay.js:287 +#: extensions/places-menu/placeDisplay.js:347 msgid "Browse Network" msgstr "Navega per la xarxa" -#: ../extensions/systemMonitor/extension.js:214 -msgid "CPU" -msgstr "CPU" +#: extensions/screenshot-window-sizer/org.gnome.shell.extensions.screenshot-window-sizer.gschema.xml:7 +msgid "Cycle Screenshot Sizes" +msgstr "Mostra cíclicament mides de captura de pantalla" -#: ../extensions/systemMonitor/extension.js:267 -msgid "Memory" -msgstr "Memòria" +#: extensions/screenshot-window-sizer/org.gnome.shell.extensions.screenshot-window-sizer.gschema.xml:11 +msgid "Cycle Screenshot Sizes Backward" +msgstr "Mostra cíclicament cap arrere mides de captura de pantalla" -#: ../extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml.in.h:1 +#: extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml:5 msgid "Theme name" msgstr "Nom del tema" -#: ../extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml.in.h:2 +#: extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml:6 msgid "The name of the theme, to be loaded from ~/.themes/name/gnome-shell" msgstr "El nom del tema que es carregarà des de ~/.themes/name/gnome-shell" -#: ../extensions/window-list/extension.js:110 +#: extensions/window-list/extension.js:110 msgid "Close" msgstr "Tanca" -#: ../extensions/window-list/extension.js:120 +#: extensions/window-list/extension.js:129 msgid "Unminimize" msgstr "Desminimitza" -#: ../extensions/window-list/extension.js:121 +#: extensions/window-list/extension.js:130 msgid "Minimize" msgstr "Minimitza" -#: ../extensions/window-list/extension.js:127 +#: extensions/window-list/extension.js:136 msgid "Unmaximize" msgstr "Desmaximitza" -#: ../extensions/window-list/extension.js:128 +#: extensions/window-list/extension.js:137 msgid "Maximize" msgstr "Maximitza" -#: ../extensions/window-list/extension.js:300 +#: extensions/window-list/extension.js:420 msgid "Minimize all" msgstr "Minimitza-ho tot" -#: ../extensions/window-list/extension.js:308 +#: extensions/window-list/extension.js:428 msgid "Unminimize all" msgstr "Desminimitza-ho tot" -#: ../extensions/window-list/extension.js:316 +#: extensions/window-list/extension.js:436 msgid "Maximize all" msgstr "Maximitza-ho tot" -#: ../extensions/window-list/extension.js:325 +#: extensions/window-list/extension.js:445 msgid "Unmaximize all" msgstr "Desmaximitza-ho tot" -#: ../extensions/window-list/extension.js:334 +#: extensions/window-list/extension.js:454 msgid "Close all" msgstr "Tanca-ho tot" -#: ../extensions/window-list/extension.js:644 -#: ../extensions/workspace-indicator/extension.js:30 +#: extensions/window-list/extension.js:678 +#: extensions/workspace-indicator/extension.js:30 msgid "Workspace Indicator" msgstr "Indicador de l'espai de treball" -#: ../extensions/window-list/extension.js:798 +#: extensions/window-list/extension.js:842 msgid "Window List" msgstr "Llista de finestres" -#: ../extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml.in.h:1 +#: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:12 msgid "When to group windows" msgstr "Quan s'han d'agrupar les finestres" -#: ../extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml.in.h:2 +#: 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\"." +"Possible values are “never”, “auto” and “always”." msgstr "" "Decideix quan s'han d'agrupar les finestres de la mateixa aplicació a la " "llista de finestres. Els valors possibles són: «never» (mai), " "«auto» (automàticament) i «always» (sempre)." -#: ../extensions/window-list/prefs.js:30 +#: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:20 +msgid "Show the window list on all monitors" +msgstr "Mostra la llista de finestres a tots els monitors" + +#: 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." +msgstr "" +"Si es mostra la llista de finestres en tots els monitors connectats o només " +"al primari." + +#: extensions/window-list/prefs.js:32 msgid "Window Grouping" msgstr "Agrupació de finestres" -#: ../extensions/window-list/prefs.js:49 +#: extensions/window-list/prefs.js:50 msgid "Never group windows" msgstr "Mai agrupes les finestres" -#: ../extensions/window-list/prefs.js:50 +#: extensions/window-list/prefs.js:51 msgid "Group windows when space is limited" msgstr "Agrupa les finestres quan l'espai estiga limitat" -#: ../extensions/window-list/prefs.js:51 +#: extensions/window-list/prefs.js:52 msgid "Always group windows" msgstr "Agrupa les finestres sempre" -#: ../extensions/workspace-indicator/prefs.js:141 +#: extensions/window-list/prefs.js:75 +msgid "Show on all monitors" +msgstr "Mostra a tots els monitors" + +#: extensions/workspace-indicator/prefs.js:141 msgid "Workspace Names" msgstr "Noms dels espais de treball" -#: ../extensions/workspace-indicator/prefs.js:157 +#: extensions/workspace-indicator/prefs.js:157 msgid "Name" msgstr "Nom" -#: ../extensions/workspace-indicator/prefs.js:198 +#: extensions/workspace-indicator/prefs.js:198 #, javascript-format msgid "Workspace %d" msgstr "Espai de treball %d" + +#~ msgid "GNOME Shell Classic" +#~ msgstr "GNOME Shell clàssic" + +#~ msgid "Window management and application launching" +#~ msgstr "Gestió de finestres i iniciació d'aplicacions" + +#~ msgid "CPU" +#~ msgstr "CPU" + +#~ msgid "Memory" +#~ msgstr "Memòria" From 01893ca0485806f181d0401b7a6347a4adaa71de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 13 Oct 2017 14:47:16 +0200 Subject: [PATCH 02/60] apps-menu: Fix whitespace errors --- extensions/apps-menu/extension.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 2f4002ad..e430140e 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -36,7 +36,7 @@ const ActivitiesMenuItem = new Lang.Class({ Extends: PopupMenu.PopupBaseMenuItem, _init: function(button) { - this.parent(); + this.parent(); this._button = button; this.actor.add_child(new St.Label({ text: _("Activities Overview") })); }, @@ -44,7 +44,7 @@ const ActivitiesMenuItem = new Lang.Class({ activate: function(event) { this._button.menu.toggle(); Main.overview.toggle(); - this.parent(event); + this.parent(event); }, }); @@ -53,8 +53,8 @@ const ApplicationMenuItem = new Lang.Class({ Extends: PopupMenu.PopupBaseMenuItem, _init: function(button, app) { - this.parent(); - this._app = app; + this.parent(); + this._app = app; this._button = button; this._iconBin = new St.Bin(); @@ -93,10 +93,10 @@ const ApplicationMenuItem = new Lang.Class({ }, activate: function(event) { - this._app.open_new_window(-1); + this._app.open_new_window(-1); this._button.selectCategory(null, null); this._button.menu.toggle(); - this.parent(event); + this.parent(event); }, setActive: function(active, params) { @@ -127,8 +127,8 @@ const CategoryMenuItem = new Lang.Class({ Extends: PopupMenu.PopupBaseMenuItem, _init: function(button, category) { - this.parent(); - this._category = category; + this.parent(); + this._category = category; this._button = button; this._oldX = -1; @@ -147,7 +147,7 @@ const CategoryMenuItem = new Lang.Class({ activate: function(event) { this._button.selectCategory(this._category, this); this._button.scrollToCatButton(this); - this.parent(event); + this.parent(event); }, _isNavigatingSubmenu: function([x, y]) { @@ -249,7 +249,7 @@ const ApplicationsMenu = new Lang.Class({ }, isEmpty: function() { - return false; + return false; }, open: function(animate) { From a0cae3d1308dcc1afda8a594e38fe6695f783413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 20 Sep 2017 03:28:13 +0200 Subject: [PATCH 03/60] naturalWindowPlacement: Remove unused stuff https://bugzilla.gnome.org/show_bug.cgi?id=787934 --- .../native-window-placement/extension.js | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index 998267e9..ca489392 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -1,20 +1,7 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- -// import just everything from workspace.js: -const Clutter = imports.gi.Clutter; -const Gio = imports.gi.Gio; const Lang = imports.lang; -const Mainloop = imports.mainloop; -const Meta = imports.gi.Meta; -const Pango = imports.gi.Pango; -const Shell = imports.gi.Shell; -const St = imports.gi.St; -const Signals = imports.signals; -const DND = imports.ui.dnd; -const Lightbox = imports.ui.lightbox; -const Main = imports.ui.main; const Overview = imports.ui.overview; -const Panel = imports.ui.panel; const Tweener = imports.ui.tweener; const Workspace = imports.ui.workspace; @@ -31,25 +18,6 @@ const WINDOW_PLACEMENT_NATURAL_ACCURACY = 20; // accuracy const WINDOW_PLACEMENT_NATURAL_GAPS = 5; // half of the minimum gap between windows const WINDOW_PLACEMENT_NATURAL_MAX_TRANSLATIONS = 5000; // safety limit for preventing endless loop if something is wrong in the algorithm -const PLACE_WINDOW_CAPTIONS_ON_TOP = true; // place window titles in overview on top of windows with overlap parameter - -const WORKSPACE_BORDER_GAP = 10; // minimum gap between the workspace area and the workspace selector -const WINDOW_AREA_TOP_GAP = 20; // minimum gap between the workspace area and the top border. This keeps window captions and close buttons visible. 13px (26/2) should currently be enough. - -const BUTTON_LAYOUT_SCHEMA = 'org.gnome.desktop.wm.preferences'; -const BUTTON_LAYOUT_KEY = 'button-layout'; - -function injectToFunction(parent, name, func) { - let origin = parent[name]; - parent[name] = function() { - let ret; - ret = origin.apply(this, arguments); - if (ret === undefined) - ret = func.apply(this, arguments); - return ret; - } -} - const Rect = new Lang.Class({ Name: 'NativeWindowPlacement.Rect', From 97d1cbca190efda23654a516bab18ee412a49c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 20 Sep 2017 02:30:06 +0200 Subject: [PATCH 04/60] naturalWindowPlacement: Don't copy relayout() function To move title captions to the top, we can simply apply a translation before calling the unmodified original function. https://bugzilla.gnome.org/show_bug.cgi?id=787934 --- .../native-window-placement/extension.js | 37 ++----------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index ca489392..e19ad64c 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -371,43 +371,12 @@ function enable() { /// position window titles on top of windows in overlay //// if (windowCaptionsOnTop) { - - /// This is almost a direct copy of the original relayout function. Differences are marked. winInjections['relayout'] = Workspace.WindowOverlay.prototype.relayout; Workspace.WindowOverlay.prototype.relayout = function(animate) { + let [, , , cloneHeight] = this._windowClone.slot; + this.title.translation_y = -cloneHeight; + winInjections['relayout'].call(this, animate); - let title = this.title; - let border = this.border; - - this._parentActor.set_child_above_sibling(title, border); - - Tweener.removeTweens(title); - - let [cloneX, cloneY, cloneWidth, cloneHeight] = this._windowClone.slot; - - // Clutter.Actor.get_preferred_width() will return the fixed width if one - // is set, so we need to reset the width by calling set_width(-1), to forward - // the call down to StLabel. - // We also need to save and restore the current width, otherwise the animation - // starts from the wrong point. - let prevTitleWidth = title.width; - title.set_width(-1); - let [titleMinWidth, titleNatWidth] = title.get_preferred_width(-1); - let titleWidth = Math.max(titleMinWidth, Math.min(titleNatWidth, cloneWidth)); - title.width = prevTitleWidth; - - let titleX = cloneX + (cloneWidth - titleWidth) / 2; - - /// this is the actual difference to original gnome-shell: - //let titleY = cloneY + cloneHeight - (title.height - this.borderSize) / 2; - let titleY = cloneY - (title.height - this.borderSize) / 2; - - if (animate) - this._animateOverlayActor(title, Math.floor(titleX), Math.floor(titleY), titleWidth); - else { - title.width = titleWidth; - title.set_position(Math.floor(titleX), Math.floor(titleY)); - } }; } } From 778eebc42121b8a3477d48c90c585e2407e42fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 20 Sep 2017 02:35:12 +0200 Subject: [PATCH 05/60] nativeWindowPlacement: Handle captions-on-top settings changes Currently the injection to move title captions to the top depends on the value of the setting at the time the extension is enabled. Instead, do the injections unconditionally and query the setting inside the function to pick up settings changes. https://bugzilla.gnome.org/show_bug.cgi?id=787934 --- extensions/native-window-placement/extension.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index e19ad64c..cce84aac 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -91,7 +91,6 @@ function enable() { let settings = Convenience.getSettings(); let useMoreScreen = settings.get_boolean('use-more-screen'); - let windowCaptionsOnTop = settings.get_boolean('window-captions-on-top'); let signalId = settings.connect('changed::use-more-screen', function() { useMoreScreen = settings.get_boolean('use-more-screen'); }); @@ -370,15 +369,15 @@ function enable() { /// position window titles on top of windows in overlay //// - if (windowCaptionsOnTop) { - winInjections['relayout'] = Workspace.WindowOverlay.prototype.relayout; - Workspace.WindowOverlay.prototype.relayout = function(animate) { + winInjections['relayout'] = Workspace.WindowOverlay.prototype.relayout; + Workspace.WindowOverlay.prototype.relayout = function(animate) { + if (settings.get_boolean('window-captions-on-top')) { let [, , , cloneHeight] = this._windowClone.slot; this.title.translation_y = -cloneHeight; + } - winInjections['relayout'].call(this, animate); - }; - } + winInjections['relayout'].call(this, animate); + }; } function removeInjection(object, injection, name) { From ef99394ffb779a115f26c65b69a7d84acdb1f3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 20 Sep 2017 02:47:49 +0200 Subject: [PATCH 06/60] nativeWindowPlacement: Use custom strategy to hook into layout Instead of copying a long function for a single changed line, wrap the layout algorithm in a LayoutStrategy so the workspace code picks it up without modifications. https://bugzilla.gnome.org/show_bug.cgi?id=787934 --- .../native-window-placement/extension.js | 158 ++++-------------- 1 file changed, 28 insertions(+), 130 deletions(-) diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index cce84aac..0796bf03 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -1,11 +1,7 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- const Lang = imports.lang; -const Overview = imports.ui.overview; -const Tweener = imports.ui.tweener; - const Workspace = imports.ui.workspace; -const WindowPositionFlags = Workspace.WindowPositionFlags; const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); @@ -78,39 +74,31 @@ const Rect = new Lang.Class({ } }); -let winInjections, workspaceInjections, connectedSignals; +const NaturalLayoutStrategy = new Lang.Class({ + Name: 'NaturalLayoutStrategy', + Extends: Workspace.LayoutStrategy, -function resetState() { - winInjections = { }; - workspaceInjections = { }; - connectedSignals = [ ]; -} + _init: function(settings) { + this._settings = settings; + }, -function enable() { - resetState(); - - let settings = Convenience.getSettings(); - let useMoreScreen = settings.get_boolean('use-more-screen'); - let signalId = settings.connect('changed::use-more-screen', function() { - useMoreScreen = settings.get_boolean('use-more-screen'); - }); - connectedSignals.push({ obj: settings, id: signalId }); + computeLayout: function(windows, layout) { + layout.windows = windows; + }, /** - * _calculateWindowTransformationsNatural: - * @clones: Array of #MetaWindow - * * Returns clones with matching target coordinates and scales to arrange windows in a natural way that no overlap exists and relative window size is preserved. * This function is almost a 1:1 copy of the function * PresentWindowsEffect::calculateWindowTransformationsNatural() from KDE, see: * https://projects.kde.org/projects/kde/kdebase/kde-workspace/repository/revisions/master/entry/kwin/effects/presentwindows/presentwindows.cpp */ - Workspace.Workspace.prototype._calculateWindowTransformationsNatural = function(clones, area) { + computeWindowSlots: function(layout, area) { // As we are using pseudo-random movement (See "slot") we need to make sure the list // is always sorted the same way no matter which window is currently active. let area_rect = new Rect(area.x, area.y, area.width, area.height); let bounds = area_rect.copy(); + let clones = layout.windows; let direction = 0; let directions = []; @@ -168,7 +156,7 @@ function enable() { rects[j].translate(diff[0], diff[1]); - if (useMoreScreen) { + if (this._settings.get_boolean('use-more-screen')) { // Try to keep the bounding rect the same aspect as the screen so that more // screen real estate is utilised. We do this by splitting the screen into nine // equal sections, if the window center is in any of the corner sections pull the @@ -258,115 +246,28 @@ function enable() { return slots; } - workspaceInjections['_calculateWindowTransformationsNatural'] = undefined; +}); - /** - * _updateWindowPositions: - * @flags: - * INITIAL - this is the initial positioning of the windows. - * ANIMATE - Indicates that we need animate changing position. - */ - workspaceInjections['_updateWindowPositions'] = Workspace.Workspace.prototype._updateWindowPositions; - Workspace.Workspace.prototype._updateWindowPositions = function(flags) { - if (this._currentLayout == null) { - this._recalculateWindowPositions(flags); - return; - } +let winInjections, workspaceInjections; - let initialPositioning = flags & WindowPositionFlags.INITIAL; - let animate = flags & WindowPositionFlags.ANIMATE; +function resetState() { + winInjections = { }; + workspaceInjections = { }; +} - let layout = this._currentLayout; - let strategy = layout.strategy; +function enable() { + resetState(); - let [, , padding] = this._getSpacingAndPadding(); - let area = Workspace.padArea(this._actualGeometry, padding); - - /// EDIT replace this version by our own: - //let slots = strategy.computeWindowSlots(layout, area); - - - /// EDIT copied from _realRecalculateWindowPositions: - let clones = this._windows.slice(); - if (clones.length == 0) - return; - - clones.sort(function(a, b) { - return a.metaWindow.get_stable_sequence() - b.metaWindow.get_stable_sequence(); - }); - - if (this._reservedSlot) - clones.push(this._reservedSlot); - - /// EDIT our own window placement function: - let slots = this._calculateWindowTransformationsNatural(clones, area); - - - let currentWorkspace = global.screen.get_active_workspace(); - let isOnCurrentWorkspace = this.metaWorkspace == null || this.metaWorkspace == currentWorkspace; - - for (let i = 0; i < slots.length; i++) { - let slot = slots[i]; - let [x, y, scale, clone] = slot; - let metaWindow = clone.metaWindow; - let overlay = clone.overlay; - clone.slotId = i; - - // Positioning a window currently being dragged must be avoided; - // we'll just leave a blank spot in the layout for it. - if (clone.inDrag) - continue; - - let cloneWidth = clone.actor.width * scale; - let cloneHeight = clone.actor.height * scale; - clone.slot = [x, y, cloneWidth, cloneHeight]; - - if (overlay && (initialPositioning || !clone.positioned)) - overlay.hide(); - - if (!clone.positioned) { - // This window appeared after the overview was already up - // Grow the clone from the center of the slot - clone.actor.x = x + cloneWidth / 2; - clone.actor.y = y + cloneHeight / 2; - clone.actor.scale_x = 0; - clone.actor.scale_y = 0; - clone.positioned = true; - } - - if (animate && isOnCurrentWorkspace) { - if (!metaWindow.showing_on_its_workspace()) { - /* Hidden windows should fade in and grow - * therefore we need to resize them now so they - * can be scaled up later */ - if (initialPositioning) { - clone.actor.opacity = 0; - clone.actor.scale_x = 0; - clone.actor.scale_y = 0; - clone.actor.x = x; - clone.actor.y = y; - } - - Tweener.addTween(clone.actor, - { opacity: 255, - time: Overview.ANIMATION_TIME, - transition: 'easeInQuad' - }); - } - - this._animateClone(clone, overlay, x, y, scale, initialPositioning); - } else { - // cancel any active tweens (otherwise they might override our changes) - Tweener.removeTweens(clone.actor); - clone.actor.set_position(x, y); - clone.actor.set_scale(scale, scale); - clone.overlay.relayout(false); - this._showWindowOverlay(clone, overlay, isOnCurrentWorkspace); - } - } - } + let settings = Convenience.getSettings(); + workspaceInjections['_getBestLayout'] = Workspace.Workspace.prototype._getBestLayout; + Workspace.Workspace.prototype._getBestLayout = function(windows) { + let strategy = new NaturalLayoutStrategy(settings); + let layout = { strategy }; + strategy.computeLayout(windows, layout); + return layout; + } /// position window titles on top of windows in overlay //// winInjections['relayout'] = Workspace.WindowOverlay.prototype.relayout; @@ -395,9 +296,6 @@ function disable() { for (i in winInjections) removeInjection(Workspace.WindowOverlay.prototype, winInjections, i); - for each (i in connectedSignals) - i.obj.disconnect(i.id); - global.stage.queue_relayout(); resetState(); } From f840f7005234fb42b257c1c808fa4625e38db3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 17 Oct 2017 17:51:35 +0200 Subject: [PATCH 07/60] Bump version to 3.27.1 Update NEWS. --- NEWS | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ec223d82..2dfe30e1 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +3.27.1 +====== +* updated translations (ca@valencia) + 3.26.1 ====== * native-window-placement: Adjust to gnome-shell changes diff --git a/configure.ac b/configure.ac index 93776e5f..0c10c853 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.63) -AC_INIT([gnome-shell-extensions],[3.26.1],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell&component=extensions]) +AC_INIT([gnome-shell-extensions],[3.27.1],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell&component=extensions]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([config]) From 99295c438d3458724386c973a91d073a732096cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Urban=C4=8Di=C4=8D?= Date: Fri, 20 Oct 2017 16:57:37 +0200 Subject: [PATCH 08/60] Updated Slovenian translation --- po/sl.po | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/po/sl.po b/po/sl.po index 4c8dc412..91f0cc86 100644 --- a/po/sl.po +++ b/po/sl.po @@ -2,7 +2,7 @@ # Copyright (C) 2011 gnome-shell-extensions's COPYRIGHT HOLDER # This file is distributed under the same license as the gnome-shell-extensions package. # -# Matej Urbančič , 2011–2017. +# Matej Urbančič , + 2011–2017. # msgid "" msgstr "" @@ -111,7 +111,7 @@ msgid "" "A list of strings, each containing an application id (desktop file name), " "followed by a colon and the workspace number" msgstr "" -"Seznam nizov z določilom ID programa (namizno ime programa), ki mu sledi " +"Seznam nizov z določilom ID programa (ime programa), ki mu sledi " "dvopičje in nato številka delovne površine." #: extensions/auto-move-windows/prefs.js:60 @@ -129,7 +129,7 @@ msgstr "Dodaj pravilo" #: extensions/auto-move-windows/prefs.js:106 msgid "Create new matching rule" -msgstr "Ustvari novo pravilo skladanja" +msgstr "Ustvari novo skladno pravilo" #: extensions/auto-move-windows/prefs.js:111 msgid "Add" @@ -160,9 +160,7 @@ msgstr "Nadomestno pozdravno besedilo." msgid "" "If not empty, it contains the text that will be shown when clicking on the " "panel." -msgstr "" -"V kolikor vrednost ni prazna, vsebuje besedilo, ki bo prikazano ob kliku na " -"pladenj." +msgstr "Vpisano besedilo bo prikazano ob kliku na pladenj." #: extensions/example/prefs.js:30 msgid "Message" @@ -176,8 +174,8 @@ msgid "" "as such it has little functionality on its own.\n" "Nevertheless it’s possible to customize the greeting message." msgstr "" -"Primer je oblikovan kot predloga za izgradnjo kakovostnih razširitev za " -"lupino, zato je delovanje deloma prilagojeno.\n" +"Primer je oblikovan kot predloga za izgradnjo kakovostnih razširitev " +"za lupino, zato je delovanje deloma prilagojeno.\n" "Kljub vsemu je mogoče prilagajati pozdravno sporočilo." #: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:5 @@ -192,7 +190,7 @@ msgid "" msgstr "" "Poskusi uporabiti več zaslona za postavitev sličic oken s prilagajanjem " "razmerja velikosti zaslona in prilagajanjem postavitve okvirja. Nastavitev " -"je mogoče uporabiti le z naravnim načinom postavitve okna." +"je mogoče uporabiti le z naravnim načinom postavitve." #: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:11 msgid "Place window captions on top" @@ -204,9 +202,9 @@ msgid "" "shell default of placing it at the bottom. Changing this setting requires " "restarting the shell to have any effect." msgstr "" -"Izbrana možnost določi postavitev nazivov oken na vrh posamezne sličice in s " -"tem prepiše privzeti izpis pod sličico. Za uveljavitev sprememb je treba " -"lupino ponovno zagnati." +"Izbrana možnost določi postavitev nazivov oken na vrh posamezne sličice" +"in s tem prepiše privzeti izpis pod sličico. Za uveljavitev sprememb je " +"treba lupino ponovno zagnati." #: extensions/places-menu/extension.js:78 #: extensions/places-menu/extension.js:81 @@ -282,11 +280,11 @@ msgstr "Pomanjšaj vse" #: extensions/window-list/extension.js:436 msgid "Maximize all" -msgstr "Razpni" +msgstr "Razpni vse" #: extensions/window-list/extension.js:445 msgid "Unmaximize all" -msgstr "_Pomanjšaj vse" +msgstr "Pomanjšaj vse" #: extensions/window-list/extension.js:454 msgid "Close all" @@ -311,7 +309,7 @@ msgid "" "Possible values are “never”, “auto” and “always”." msgstr "" "Določi, kdaj se okna istega programa v seznamu programov združujejo. " -"Veljavne vrednosti so \"nikoli\", \"samodejno\" in \"vedno\"." +"Veljavne vrednosti so »nikoli«, »samodejno« in »vedno«." #: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:20 msgid "Show the window list on all monitors" @@ -322,7 +320,7 @@ msgid "" "Whether to show the window list on all connected monitors or only on the " "primary one." msgstr "" -"Ali naj bo prikazan seznam okna na vseh povezanih zasloni ali le na osnovnem." +"Ali naj bo prikazan seznam oken na vseh povezanih zasloni ali le na osnovnem." #: extensions/window-list/prefs.js:32 msgid "Window Grouping" @@ -334,11 +332,11 @@ msgstr "Nikoli ne združuj oken" #: extensions/window-list/prefs.js:51 msgid "Group windows when space is limited" -msgstr "Združi okna v skupine, ko je prostor omejen" +msgstr "Združi okna, ko je prostor omejen" #: extensions/window-list/prefs.js:52 msgid "Always group windows" -msgstr "Vedno združuj okna" +msgstr "Okna vedno združi" #: extensions/window-list/prefs.js:75 msgid "Show on all monitors" @@ -416,9 +414,9 @@ msgstr "Delovna površina %d" #~ "are 'thumbnail-only' (shows a thumbnail of the window), 'app-icon-" #~ "only' (shows only the application icon) or 'both'." #~ msgstr "" -#~ "Nastavitev prikaza oken v preklopniku. Veljavne možnosti so 'le sličice', " -#~ "kar pokaže pomanjšano sličico okna, 'le ikono programa', kar pokaže ikono " -#~ "in možnost 'oboje', torej ikono in pomanjšano sličico." +#~ "Nastavitev prikaza oken v preklopniku. Veljavne možnosti so »le sličice«, " +#~ "kar pokaže pomanjšano sličico okna, »le ikona programa«, kar pokaže ikono " +#~ "in možnost »oboje«, torej ikono in pomanjšano sličico." #~ msgid "Devices" #~ msgstr "Naprave" @@ -451,8 +449,8 @@ msgstr "Delovna površina %d" #~ "Sets the position of the dock in the screen. Allowed values are 'right' " #~ "or 'left'" #~ msgstr "" -#~ "Določi položaj sidrišča na zaslonu. Dovoljeni vrednosti sta 'desno' ali " -#~ "'levo'." +#~ "Določi položaj sidrišča na zaslonu. Dovoljeni vrednosti sta »desno« ali " +#~ "»levo«." #~ msgid "Icon size" #~ msgstr "Velikost ikone" @@ -470,8 +468,8 @@ msgstr "Delovna površina %d" #~ "Sets the effect of the hide dock. Allowed values are 'resize', 'rescale' " #~ "and 'move'" #~ msgstr "" -#~ "Določi učinek skrivanja sidrišča. Dovoljeni vrednosti sta 'spremeni " -#~ "velikost', 'prilagodi velikost' ali 'premakni'." +#~ "Določi učinek skrivanja sidrišča. Dovoljeni vrednosti sta »spremeni " +#~ "velikost«, »prilagodi velikost« ali »premakni«." #~ msgid "Autohide duration" #~ msgstr "Trajanje samodejnega skrivanja" @@ -511,8 +509,8 @@ msgstr "Delovna površina %d" #~ "Sets the Alt-Tab behaviour. Possible values are: all_thumbnails and " #~ "workspace_icons. See the configuration dialogs for details." #~ msgstr "" -#~ "Določi obnašanje tipk Alt-Tab. Mogoče vrednosti so: vse_sličice in " -#~ "ikone_delovne_površine. Za več podrobnosti si oglejte nastavitve." +#~ "Določi obnašanje tipk Alt-Tab. Mogoče vrednosti so: »vse sličice« in " +#~ "»ikone delovne površine«. Za več podrobnosti si oglejte nastavitve." #~ msgid "" #~ "This mode presents all applications from all workspaces in one selection " From 8c551ba8ee0bf1802a519f2a61f50e4ae4a2005f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 20 Oct 2017 17:59:28 +0200 Subject: [PATCH 09/60] windowsNavigator: Use regular for() loops "for each ... in" has been deprecated for a long time and won't be supported in upcoming SpiderMonkey versions, so replace it with "for ... of" instead. --- extensions/windowsNavigator/extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js index c19ff0c0..f674effd 100644 --- a/extensions/windowsNavigator/extension.js +++ b/extensions/windowsNavigator/extension.js @@ -274,10 +274,10 @@ function disable() { for (i in workViewInjections) removeInjection(WorkspacesView.WorkspacesView.prototype, workViewInjections, i); - for each (i in connectedSignals) + for (i of connectedSignals) i.obj.disconnect(i.id); - for each (i in createdActors) + for (i of createdActors) i.destroy(); resetState(); From 2460ac9df8915816e0db0359afcbab81f37ee0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 26 Oct 2017 20:01:04 +0200 Subject: [PATCH 10/60] auto-move: Remove unused imports --- extensions/auto-move-windows/prefs.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index cc542b2c..31f4c9ea 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -1,14 +1,10 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- // Start apps on custom workspaces -const GdkPixbuf = imports.gi.GdkPixbuf; const Gio = imports.gi.Gio; -const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; -const GMenu = imports.gi.GMenu; const Gtk = imports.gi.Gtk; const Lang = imports.lang; -const Mainloop = imports.mainloop; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; From 40c6b8b1d8a6f78b5e95d8b04c669196cc9aba3b Mon Sep 17 00:00:00 2001 From: Kjartan Maraas Date: Mon, 6 Nov 2017 13:41:21 +0100 Subject: [PATCH 11/60] =?UTF-8?q?Updated=20Norwegian=20bokm=C3=A5l=20trans?= =?UTF-8?q?lation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- po/nb.po | 64 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/po/nb.po b/po/nb.po index 7c4c56a7..66114ec1 100644 --- a/po/nb.po +++ b/po/nb.po @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: gnome-shell-extensions 3.23.x\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell&keywords=I18N+L10N&component=extensions\n" -"POT-Creation-Date: 2017-02-16 01:20+0000\n" -"PO-Revision-Date: 2017-02-19 17:40+0100\n" +"Project-Id-Version: gnome-shell-extensions 3.26.x\n" +"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell&keywords=I18N+L10N&component=extensions\n" +"POT-Creation-Date: 2017-10-04 18:03+0000\n" +"PO-Revision-Date: 2017-11-06 13:40+0100\n" "Last-Translator: Kjartan Maraas \n" "Language-Team: Norwegian bokmål \n" "Language: nb\n" @@ -83,15 +83,15 @@ msgstr "Vis vinduer som" msgid "Show only windows in the current workspace" msgstr "Vis kun vinduer i aktivt arbeidsområde" -#: extensions/apps-menu/extension.js:38 +#: extensions/apps-menu/extension.js:41 msgid "Activities Overview" msgstr "Aktivitetsoversikt" -#: extensions/apps-menu/extension.js:109 +#: extensions/apps-menu/extension.js:141 msgid "Favorites" msgstr "Favoritter" -#: extensions/apps-menu/extension.js:266 +#: extensions/apps-menu/extension.js:436 msgid "Applications" msgstr "Programmer" @@ -128,17 +128,18 @@ msgstr "Lag en ny regel for treff" msgid "Add" msgstr "Legg til" -#: extensions/drive-menu/extension.js:106 +#. TRANSLATORS: %s is the filesystem name +#: extensions/drive-menu/extension.js:107 #, javascript-format msgid "Ejecting drive “%s” failed:" msgstr "Utløsing av stasjon «%s» feilet:" -#: extensions/drive-menu/extension.js:124 +#: extensions/drive-menu/extension.js:125 msgid "Removable devices" msgstr "Avtagbare enheter" -#: extensions/drive-menu/extension.js:149 -msgid "Open File" +#: extensions/drive-menu/extension.js:150 +msgid "Open Files" msgstr "Åpne fil" #: extensions/example/extension.js:17 @@ -209,21 +210,26 @@ msgstr "" msgid "Places" msgstr "Steder" -#: extensions/places-menu/placeDisplay.js:59 +#: extensions/places-menu/placeDisplay.js:65 +#, javascript-format +msgid "Failed to mount volume for “%s”" +msgstr "Klarte ikke å montere volum for «%s»" + +#: extensions/places-menu/placeDisplay.js:78 #, javascript-format msgid "Failed to launch “%s”" msgstr "Klarte ikke å starte «%s»" -#: extensions/places-menu/placeDisplay.js:101 -#: extensions/places-menu/placeDisplay.js:124 +#: extensions/places-menu/placeDisplay.js:137 +#: extensions/places-menu/placeDisplay.js:160 msgid "Computer" msgstr "Datamaskin" -#: extensions/places-menu/placeDisplay.js:267 +#: extensions/places-menu/placeDisplay.js:303 msgid "Home" msgstr "Hjem" -#: extensions/places-menu/placeDisplay.js:311 +#: extensions/places-menu/placeDisplay.js:347 msgid "Browse Network" msgstr "Bla gjennom nettverk" @@ -231,6 +237,10 @@ msgstr "Bla gjennom nettverk" msgid "Cycle Screenshot Sizes" msgstr "Bla gjennom størrelser på skjermdump" +#: extensions/screenshot-window-sizer/org.gnome.shell.extensions.screenshot-window-sizer.gschema.xml:11 +msgid "Cycle Screenshot Sizes Backward" +msgstr "Bla gjennom størrelser på skjermdump baklengs" + #: extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml:5 msgid "Theme name" msgstr "Navn på tema" @@ -243,48 +253,48 @@ msgstr "Navn på tema som skal lastes fra ~/.themes/name/gnome-shell" msgid "Close" msgstr "Lukk" -#: extensions/window-list/extension.js:120 +#: extensions/window-list/extension.js:129 msgid "Unminimize" msgstr "Gjenopprett" -#: extensions/window-list/extension.js:121 +#: extensions/window-list/extension.js:130 msgid "Minimize" msgstr "Minimer" -#: extensions/window-list/extension.js:127 +#: extensions/window-list/extension.js:136 msgid "Unmaximize" msgstr "Gjenopprett" -#: extensions/window-list/extension.js:128 +#: extensions/window-list/extension.js:137 msgid "Maximize" msgstr "Maksimer" -#: extensions/window-list/extension.js:411 +#: extensions/window-list/extension.js:420 msgid "Minimize all" msgstr "Minimer alle" -#: extensions/window-list/extension.js:419 +#: extensions/window-list/extension.js:428 msgid "Unminimize all" msgstr "Gjenopprett alle" -#: extensions/window-list/extension.js:427 +#: extensions/window-list/extension.js:436 msgid "Maximize all" msgstr "Maksimer alle" -#: extensions/window-list/extension.js:436 +#: extensions/window-list/extension.js:445 msgid "Unmaximize all" msgstr "Gjenopprett alle" -#: extensions/window-list/extension.js:445 +#: extensions/window-list/extension.js:454 msgid "Close all" msgstr "Lukk alle" -#: extensions/window-list/extension.js:669 +#: extensions/window-list/extension.js:678 #: extensions/workspace-indicator/extension.js:30 msgid "Workspace Indicator" msgstr "Arbeidsområdeindikator" -#: extensions/window-list/extension.js:833 +#: extensions/window-list/extension.js:842 msgid "Window List" msgstr "Vinduliste" From 29ea5ca1a914900c3d9545fc0720efac205144cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 24 Nov 2017 23:02:19 +0100 Subject: [PATCH 12/60] build: Update bug tracker to gitlab --- README | 3 +-- configure.ac | 2 +- gnome-shell-extensions.doap | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README b/README index cc53a8df..4d8b3cd4 100644 --- a/README +++ b/README @@ -12,8 +12,7 @@ For more information about GNOME Shell Extensions For general information about GNOME Shell https://wiki.gnome.org/Projects/GnomeShell -Bugs should be reported at https://bugzilla.gnome.org against the 'gnome-shell' -product, with the 'extensions' component. +Bugs should be reported at https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues. Extensions ========== diff --git a/configure.ac b/configure.ac index 0c10c853..a6a1ced9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.63) -AC_INIT([gnome-shell-extensions],[3.27.1],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell&component=extensions]) +AC_INIT([gnome-shell-extensions],[3.27.1],[https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([config]) diff --git a/gnome-shell-extensions.doap b/gnome-shell-extensions.doap index ec4b1025..74ca9ddf 100644 --- a/gnome-shell-extensions.doap +++ b/gnome-shell-extensions.doap @@ -15,7 +15,7 @@ and will be picked automatically at next login. - + JavaScript From 76526a9c2d4d8ef5be3035c1a478927a45269344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 25 Nov 2017 01:52:02 +0100 Subject: [PATCH 13/60] Update README Over the years the list of extensions has become seriously outdated - a number of extensions has long been removed, while others have been added. With the switch to gitlab, the README is displayed prominently, so make sure the list is accurate again. --- README | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README b/README index 4d8b3cd4..647fd5d4 100644 --- a/README +++ b/README @@ -31,10 +31,6 @@ auto-move-windows each application as soon as it creates a window, in a manner configurable with a GSettings key. -dock - - Shows a dock-style task switcher on the right side of the screen. - drive-menu Shows a status menu for rapid unmount and power off of external storage devices (i.e. pendrives) @@ -43,9 +39,9 @@ example A minimal example illustrating how to write extensions. -gajim +launch-new-instance - Integration with Gajim, a Jabber/XMPP instant messaging client. + Changes application icons to always launch a new instance when activated. native-window-placement @@ -56,14 +52,26 @@ places-menu Shows a status Indicator for navigating to Places. +screenshot-window-sizer + + Adds a shortcut for resizing the focus window to a size that is suitable for GNOME Software screenshots + user-theme Loads a shell theme from ~/.themes//gnome-shell. +window-list + + Adds a bottom panel with a traditional window list. + windowsNavigator Allow keyboard selection of windows and workspaces in overlay mode. +workspace-indicator + + Adds a simple workspace switcher to the top bar. + License ======= GNOME Shell Extensions are distributed under the terms of the GNU General Public License, From 724249dd2981347bbf8a9aa09b0e6273e55da0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 25 Nov 2017 02:06:58 +0100 Subject: [PATCH 14/60] docs: Use markdown Markdown produces nicer output where supported, so use that instead of custom ASCII formatting. --- HACKING => HACKING.md | 12 +++---- README | 81 ----------------------------------------- README.md | 84 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 87 deletions(-) rename HACKING => HACKING.md (76%) delete mode 100644 README create mode 100644 README.md diff --git a/HACKING b/HACKING.md similarity index 76% rename from HACKING rename to HACKING.md index 3bc2444f..217bd505 100644 --- a/HACKING +++ b/HACKING.md @@ -1,4 +1,4 @@ ---- Creating a New Extension --- +## Creating a New Extension To create a new extension, add a subdirectory in extensions. Then create a Makefile.am like the one in example, replacing @@ -15,12 +15,10 @@ The Gettext domain you should choose is gnome-shell-extensions, not gnome-shell, unless you're sure there is the string you need in gnome-shell. ---- Coding Style --- +## Coding Style -Generally, we follow GJS coding style (you can find it at -http://git.gnome.org/browse/gjs/tree/doc/Style_Guide.txt), which -in short is: indent 4 spaces, no tabs, space after comma, no space -after function call. +Generally, we follow [GJS coding style][coding-style], which in short is: +indent 4 spaces, no tabs, space after comma, no space after function call. The Emacs mode line for this /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ @@ -29,3 +27,5 @@ Imports should be at the top, in two groups, one for standard imports (like imports.lang or imports.dbus) and introspection, the other for Shell API. Within the same group, put everything in alphabetic order. + +[coding-style]: https://gitlab.gnome.org/GNOME/gjs/blob/master/doc/Style_Guide.md diff --git a/README b/README deleted file mode 100644 index 647fd5d4..00000000 --- a/README +++ /dev/null @@ -1,81 +0,0 @@ -GNOME Shell Extensions is a collection of extensions providing additional -and optional functionality to GNOME Shell. - -Since GNOME Shell is not API stable, extensions work only against a very -specific version of the shell, usually the same as this package (see -"configure --version"). The extensions in this package are supported by GNOME -and will be updated to reflect future API changes in GNOME Shell. - -For more information about GNOME Shell Extensions - https://wiki.gnome.org/Projects/GnomeShell/Extensions - -For general information about GNOME Shell - https://wiki.gnome.org/Projects/GnomeShell - -Bugs should be reported at https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues. - -Extensions -========== - -alternate-tab - - Lets you use classic Alt+Tab (window-based instead of app-based) in GNOME Shell. - -apps-menu - - Lets you reach an application using gnome 2.x style menu on the panel. - -auto-move-windows - - Lets you manage your workspaces more easily, assigning a specific workspace to -each application as soon as it creates a window, in a manner configurable with a -GSettings key. - -drive-menu - Shows a status menu for rapid unmount and power off of external storage devices - (i.e. pendrives) - -example - - A minimal example illustrating how to write extensions. - -launch-new-instance - - Changes application icons to always launch a new instance when activated. - -native-window-placement - - An alternative algorithm for layouting the thumbnails in the windows overview, that - more closely reflects the actual positions and sizes. - -places-menu - - Shows a status Indicator for navigating to Places. - -screenshot-window-sizer - - Adds a shortcut for resizing the focus window to a size that is suitable for GNOME Software screenshots - -user-theme - - Loads a shell theme from ~/.themes//gnome-shell. - -window-list - - Adds a bottom panel with a traditional window list. - -windowsNavigator - - Allow keyboard selection of windows and workspaces in overlay mode. - -workspace-indicator - - Adds a simple workspace switcher to the top bar. - -License -======= -GNOME Shell Extensions are distributed under the terms of the GNU General Public License, -version 2 or later. See the COPYING file for details. -Individual extensions may be licensed under different terms, see each source -file for details. - diff --git a/README.md b/README.md new file mode 100644 index 00000000..f9872dde --- /dev/null +++ b/README.md @@ -0,0 +1,84 @@ +# GNOME Shell Extensions + +GNOME Shell Extensions is a collection of extensions providing additional +and optional functionality to GNOME Shell. + +Since GNOME Shell is not API stable, extensions work only against a very +specific version of the shell, usually the same as this package (see +"configure --version"). The extensions in this package are supported by GNOME +and will be updated to reflect future API changes in GNOME Shell. + +The GNOME wiki has more information about [GNOME Shell Extensions][project-page], +as well as some general information about [GNOME Shell][shell-page]. + +Bugs should be reported to the GNOME [bug tracking system][bug-tracker]. + +## Extensions + + * alternate-tab + + Lets you use classic Alt+Tab (window-based instead of app-based) in GNOME Shell. + + * apps-menu + + Lets you reach an application using gnome 2.x style menu on the panel. + + * auto-move-windows + + Lets you manage your workspaces more easily, assigning a specific workspace to +each application as soon as it creates a window, in a manner configurable with a +GSettings key. + + * drive-menu + + Shows a status menu for rapid unmount and power off of external storage devices + (i.e. pendrives) + + * example + + A minimal example illustrating how to write extensions. + + * launch-new-instance + + Changes application icons to always launch a new instance when activated. + + * native-window-placement + + An alternative algorithm for layouting the thumbnails in the windows overview, that + more closely reflects the actual positions and sizes. + + * places-menu + + Shows a status Indicator for navigating to Places. + + * screenshot-window-sizer + + Adds a shortcut for resizing the focus window to a size that is suitable for GNOME Software screenshots + + * user-theme + + Loads a shell theme from ~/.themes//gnome-shell. + + * window-list + + Adds a bottom panel with a traditional window list. + + * windowsNavigator + + Allow keyboard selection of windows and workspaces in overlay mode. + + * workspace-indicator + + Adds a simple workspace switcher to the top bar. + +## License + +GNOME Shell Extensions are distributed under the terms of the GNU General +Public License, version 2 or later. See the [COPYING file][license] for details. +Individual extensions may be licensed under different terms, see each source +file for details. + +[project-page]: https://wiki.gnome.org/Projects/GnomeShell/Extensions +[shell-page]: https://wiki.gnome.org/Projects/GnomeShell +[bug-tracker]: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues +[license]: COPYING From eb425ac8a2faa56c974c6bae91ad6d67db46d38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Lefevre?= Date: Sat, 6 Feb 2016 15:06:05 +0100 Subject: [PATCH 15/60] places-menu: Support unmounting ejectable places Being able to unmount places that can be ejected directly from the menu is convenient and consistent with Nautilus, so add an eject button to items that are removable. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/17 --- extensions/places-menu/extension.js | 10 ++++++- extensions/places-menu/placeDisplay.js | 40 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index 767fb878..f7c11c65 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -35,9 +35,17 @@ const PlaceMenuItem = new Lang.Class({ icon_size: PLACE_ICON_SIZE }); this.actor.add_child(this._icon); - this._label = new St.Label({ text: info.name }); + this._label = new St.Label({ text: info.name, x_expand: true }); this.actor.add_child(this._label); + if (info.isRemovable()) { + this._ejectIcon = new St.Icon({ icon_name: 'media-eject-symbolic', + style_class: 'popup-menu-icon ' }); + this._ejectButton = new St.Button({ child: this._ejectIcon }); + this._ejectButton.connect('clicked', Lang.bind(info, info.eject)); + this.actor.add_child(this._ejectButton); + } + this._changedId = info.connect('changed', Lang.bind(this, this._propertiesChanged)); }, diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index ba316bff..796619c0 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -180,6 +180,46 @@ const PlaceDeviceInfo = new Lang.Class({ getIcon: function() { return this._mount.get_symbolic_icon(); + }, + + isRemovable: function() { + return this._mount.can_eject(); + }, + + eject: function() { + let mountOp = new ShellMountOperation.ShellMountOperation(this._mount); + + if (this._mount.can_eject()) + this._mount.eject_with_operation(Gio.MountUnmountFlags.NONE, + mountOp.mountOp, + null, // Gio.Cancellable + Lang.bind(this, this._ejectFinish)); + else + this._mount.unmount_with_operation(Gio.MountUnmountFlags.NONE, + mountOp.mountOp, + null, // Gio.Cancellable + Lang.bind(this, this._unmountFinish)); + }, + + _ejectFinish: function(mount, result) { + try { + mount.eject_with_operation_finish(result); + } catch(e) { + this._reportFailure(e); + } + }, + + _unmountFinish: function(mount, result) { + try { + mount.unmount_with_operation_finish(result); + } catch(e) { + this._reportFailure(e); + } + }, + + _reportFailure: function(exception) { + let msg = _("Ejecting drive '%s' failed:").format(this._mount.get_name()); + Main.notifyError(msg, exception.message); } }); From 8bd35eeb09b75dce18aa88dc6a23a21da4980668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 13 Oct 2017 00:30:31 +0200 Subject: [PATCH 16/60] apps-menu: Don't override sort order Keep the order in which GMenu returns loaded apps, so users can reorder entries in Alacarte. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/27 --- extensions/apps-menu/extension.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index e430140e..dba31e7b 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -745,9 +745,6 @@ const ApplicationsButton = new Lang.Class({ if (category_menu_id) { applist = this.applicationsByCategory[category_menu_id]; - applist.sort(function(a,b) { - return a.get_name().toLowerCase() > b.get_name().toLowerCase(); - }); } else { applist = new Array(); let favorites = global.settings.get_strv('favorite-apps'); From 077a292952ac6d2b752a4826519b710770e25ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 13 Oct 2017 01:43:20 +0200 Subject: [PATCH 17/60] apps-menu: Reload on tree changes Now that we respect the sort order defined in the .menu file, make sure to reload the menu on those changes as well, not just when the installed apps themselves change. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/27 --- extensions/apps-menu/extension.js | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index dba31e7b..600eda3d 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -466,18 +466,25 @@ const ApplicationsButton = new Lang.Class({ }); }); + this._tree = new GMenu.Tree({ menu_basename: 'applications.menu' }); + this._treeChangedId = this._tree.connect('changed', + Lang.bind(this, this._onTreeChanged)); + this._applicationsButtons = new Map(); this.reloadFlag = false; this._createLayout(); this._display(); - this._installedChangedId = appSys.connect('installed-changed', Lang.bind(this, function() { - if (this.menu.isOpen) { - this._redisplay(); - this.mainBox.show(); - } else { - this.reloadFlag = true; - } - })); + this._installedChangedId = appSys.connect('installed-changed', + Lang.bind(this, this._onTreeChanged)); + }, + + _onTreeChanged: function() { + if (this.menu.isOpen) { + this._redisplay(); + this.mainBox.show(); + } else { + this.reloadFlag = true; + } }, get hotCorner() { @@ -495,6 +502,8 @@ const ApplicationsButton = new Lang.Class({ Main.overview.disconnect(this._showingId); Main.overview.disconnect(this._hidingId); appSys.disconnect(this._installedChangedId); + this._tree.disconnect(this._treeChangedId); + this._tree = null; Main.wm.setCustomKeybindingHandler('panel-main-menu', Shell.ActionMode.NORMAL | @@ -675,9 +684,8 @@ const ApplicationsButton = new Lang.Class({ //Load categories this.applicationsByCategory = {}; - let tree = new GMenu.Tree({ menu_basename: 'applications.menu' }); - tree.load_sync(); - let root = tree.get_root_directory(); + this._tree.load_sync(); + let root = this._tree.get_root_directory(); let categoryMenuItem = new CategoryMenuItem(this, null); this.categoriesBox.add_actor(categoryMenuItem.actor); let iter = root.iter(); From d86044f383b286cb58709736550a94e880998215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 13 Oct 2017 01:20:17 +0200 Subject: [PATCH 18/60] apps-menu: Minor code cleanup The parameter to _clearApplicationBox() has never been used, so remove it. In fact, modern javascript makes the function so compact that we can just move the code inline. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/27 --- extensions/apps-menu/extension.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 600eda3d..8138d4ca 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -712,19 +712,10 @@ const ApplicationsButton = new Lang.Class({ this.mainBox.style+=('height: ' + height); }, - _clearApplicationsBox: function(selectedActor) { - let actors = this.applicationsBox.get_children(); - for (let i = 0; i < actors.length; i++) { - let actor = actors[i]; - this.applicationsBox.remove_actor(actor); - } - }, - selectCategory: function(dir, categoryMenuItem) { - if (categoryMenuItem) - this._clearApplicationsBox(categoryMenuItem.actor); - else - this._clearApplicationsBox(null); + this.applicationsBox.get_children().forEach(c => { + this.applicationsBox.remove_actor(c); + }); if (dir) this._displayButtons(this._listApplications(dir.get_menu_id())); From 21315d74c3be019d43074e4d3d7b01e866d95b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 13 Oct 2017 01:44:19 +0200 Subject: [PATCH 19/60] apps-menu: Support separators We currently only load entries and directories, and ignore any separators defined by the user/admin. Make some people happy by supporting them ... Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/27 --- extensions/apps-menu/extension.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 8138d4ca..c2ecf5f5 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -592,6 +592,8 @@ const ApplicationsButton = new Lang.Class({ app = new Shell.App({ app_info: entry.get_app_info() }); if (app.get_app_info().should_show()) this.applicationsByCategory[categoryId].push(app); + } else if (nextType == GMenu.TreeItemType.SEPARATOR) { + this.applicationsByCategory[categoryId].push('separator'); } else if (nextType == GMenu.TreeItemType.DIRECTORY) { let subdir = iter.get_directory(); if (!subdir.get_is_nodisplay()) @@ -714,7 +716,10 @@ const ApplicationsButton = new Lang.Class({ selectCategory: function(dir, categoryMenuItem) { this.applicationsBox.get_children().forEach(c => { - this.applicationsBox.remove_actor(c); + if (c._delegate instanceof PopupMenu.PopupSeparatorMenuItem) + c._delegate.destroy(); + else + this.applicationsBox.remove_actor(c); }); if (dir) @@ -727,7 +732,11 @@ const ApplicationsButton = new Lang.Class({ if (apps) { for (let i = 0; i < apps.length; i++) { let app = apps[i]; - let item = this._applicationsButtons.get(app); + let item; + if (app instanceof Shell.App) + item = this._applicationsButtons.get(app); + else + item = new PopupMenu.PopupSeparatorMenuItem(); if (!item) { item = new ApplicationMenuItem(this, app); item.setDragEnabled(this._desktopTarget.hasDesktop); From a26f9e34c724f91b93dd09db33a7bf493e17e9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Dr=C4=85g?= Date: Sat, 25 Nov 2017 16:21:35 +0100 Subject: [PATCH 20/60] places-menu: Use Unicode quotation marks in a new string See https://developer.gnome.org/hig/stable/typography.html https://bugzilla.gnome.org/show_bug.cgi?id=772211 --- extensions/places-menu/placeDisplay.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index 796619c0..34c594e8 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -218,7 +218,7 @@ const PlaceDeviceInfo = new Lang.Class({ }, _reportFailure: function(exception) { - let msg = _("Ejecting drive '%s' failed:").format(this._mount.get_name()); + let msg = _("Ejecting drive “%s” failed:").format(this._mount.get_name()); Main.notifyError(msg, exception.message); } }); From c6ecf2c0dfbf3282365648836b882b7996367709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 29 Nov 2017 20:18:43 +0100 Subject: [PATCH 21/60] build: Update repo URL in metadata --- include.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include.mk b/include.mk index 0407a512..3ab665f9 100644 --- a/include.mk +++ b/include.mk @@ -1,4 +1,4 @@ -extensionurl = http://git.gnome.org/gnome-shell-extensions +extensionurl = https://gitlab.gnome.org/GNOME/gnome-shell-extensions # Change these to modify how installation is performed topextensiondir = $(datadir)/gnome-shell/extensions From 3ab01aebecf57e49c12fa1e5e6c5cc130e267808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 9 Apr 2017 06:09:04 +0200 Subject: [PATCH 22/60] build: Support the meson build system Meson is on track to replace autotools as the build system of choice, so support it in addition to autotools. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/31 --- data/meson.build | 58 +++++++++++ data/update-theme.sh | 9 ++ extensions/alternate-tab/meson.build | 7 ++ extensions/apps-menu/meson.build | 5 + extensions/auto-move-windows/meson.build | 8 ++ extensions/drive-menu/meson.build | 5 + extensions/example/meson.build | 8 ++ extensions/launch-new-instance/meson.build | 5 + extensions/meson.build | 28 ++++++ .../native-window-placement/meson.build | 7 ++ extensions/places-menu/meson.build | 7 ++ .../screenshot-window-sizer/meson.build | 7 ++ extensions/user-theme/meson.build | 7 ++ extensions/window-list/meson.build | 12 +++ extensions/windowsNavigator/meson.build | 5 + extensions/workspace-indicator/meson.build | 7 ++ meson.build | 96 +++++++++++++++++++ meson_options.txt | 18 ++++ po/meson.build | 1 + 19 files changed, 300 insertions(+) create mode 100644 data/meson.build create mode 100755 data/update-theme.sh create mode 100644 extensions/alternate-tab/meson.build create mode 100644 extensions/apps-menu/meson.build create mode 100644 extensions/auto-move-windows/meson.build create mode 100644 extensions/drive-menu/meson.build create mode 100644 extensions/example/meson.build create mode 100644 extensions/launch-new-instance/meson.build create mode 100644 extensions/meson.build create mode 100644 extensions/native-window-placement/meson.build create mode 100644 extensions/places-menu/meson.build create mode 100644 extensions/screenshot-window-sizer/meson.build create mode 100644 extensions/user-theme/meson.build create mode 100644 extensions/window-list/meson.build create mode 100644 extensions/windowsNavigator/meson.build create mode 100644 extensions/workspace-indicator/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 po/meson.build diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 00000000..7cd388d3 --- /dev/null +++ b/data/meson.build @@ -0,0 +1,58 @@ +sessions = [ + ['gnome-classic.session.desktop', sessiondir], + ['gnome-classic.desktop', xsessiondir] +] +foreach s : sessions + i18n.merge_file('', + input: s[0] + '.in', + output: s[0], + po_dir: '../po', + install: true, + install_dir: s[1], + type: 'desktop' + ) +endforeach + +mode_conf = configuration_data() +mode_conf.set('CLASSIC_EXTENSIONS', ','.join(classic_extensions)) + +mode_file = 'classic.json' +configure_file( + input: mode_file + '.in', + output: mode_file, + configuration: mode_conf, + install_dir: modedir +) + +theme_sources = files( + 'gnome-shell-sass/_colors.scss', + 'gnome-shell-sass/_common.scss', + 'gnome-shell-sass/_drawing.scss', + 'gnome-shell-sass/_high-contrast-colors.scss' +) + +theme_data = [ + 'calendar-today.svg', + 'classic-process-working.svg', + 'classic-toggle-off-intl.svg', + 'classic-toggle-off-us.svg', + 'classic-toggle-on-intl.svg', + 'classic-toggle-on-us.svg', + 'gnome-classic.css', + 'gnome-classic-high-contrast.css' +] + +update_theme = files('update-theme.sh') + +if sassc.found() + style = 'gnome-classic' + custom_target(style + '.css', + input: style + '.scss', + output: style + '.css', + depend_files: theme_sources + files(style + '.css'), + command: [update_theme, '@INPUT@', '@OUTPUT@'], + build_by_default: true + ) +endif + +install_data(theme_data, install_dir: themedir) diff --git a/data/update-theme.sh b/data/update-theme.sh new file mode 100755 index 00000000..f8d2a0d5 --- /dev/null +++ b/data/update-theme.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +INPUT=$1 +OUTPUT=$2 + +if [ `which sassc` ] +then + sassc -a $INPUT | tee ${INPUT%%.scss}.css > $OUTPUT +fi diff --git a/extensions/alternate-tab/meson.build b/extensions/alternate-tab/meson.build new file mode 100644 index 00000000..71efa039 --- /dev/null +++ b/extensions/alternate-tab/meson.build @@ -0,0 +1,7 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) + +extension_sources += files('prefs.js') diff --git a/extensions/apps-menu/meson.build b/extensions/apps-menu/meson.build new file mode 100644 index 00000000..48504f63 --- /dev/null +++ b/extensions/apps-menu/meson.build @@ -0,0 +1,5 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) diff --git a/extensions/auto-move-windows/meson.build b/extensions/auto-move-windows/meson.build new file mode 100644 index 00000000..c55a7830 --- /dev/null +++ b/extensions/auto-move-windows/meson.build @@ -0,0 +1,8 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) + +extension_sources += files('prefs.js') +extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml') diff --git a/extensions/drive-menu/meson.build b/extensions/drive-menu/meson.build new file mode 100644 index 00000000..48504f63 --- /dev/null +++ b/extensions/drive-menu/meson.build @@ -0,0 +1,5 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) diff --git a/extensions/example/meson.build b/extensions/example/meson.build new file mode 100644 index 00000000..c55a7830 --- /dev/null +++ b/extensions/example/meson.build @@ -0,0 +1,8 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) + +extension_sources += files('prefs.js') +extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml') diff --git a/extensions/launch-new-instance/meson.build b/extensions/launch-new-instance/meson.build new file mode 100644 index 00000000..48504f63 --- /dev/null +++ b/extensions/launch-new-instance/meson.build @@ -0,0 +1,5 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) diff --git a/extensions/meson.build b/extensions/meson.build new file mode 100644 index 00000000..30bc053f --- /dev/null +++ b/extensions/meson.build @@ -0,0 +1,28 @@ +extension_schemas = [] + +metadata_name = 'metadata.json' + +foreach e : enabled_extensions + uuid = e + '@gnome-shell-extensions.gcampax.github.com' + + metadata_conf = configuration_data() + metadata_conf.set('extension_id', e) + metadata_conf.set('uuid', uuid) + metadata_conf.set('gschemaname', 'org.gnome.shell.extensions.' + e) + metadata_conf.set('gettext_domain', gettext_domain) + metadata_conf.set('shell_current', shell_version) + metadata_conf.set('url', 'https://gitlab.gnome.org/GNOME/gnome-shell-extensions') + + extension_sources = files(e + '/extension.js') + extension_data = files(e + '/stylesheet.css') + + subdir(e) + + install_data (extension_sources + extension_data + extensionlib, + install_dir: join_paths(extensiondir, uuid) + ) +endforeach + +install_data (extension_schemas, + install_dir: schemadir +) diff --git a/extensions/native-window-placement/meson.build b/extensions/native-window-placement/meson.build new file mode 100644 index 00000000..585c02da --- /dev/null +++ b/extensions/native-window-placement/meson.build @@ -0,0 +1,7 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) + +extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml') diff --git a/extensions/places-menu/meson.build b/extensions/places-menu/meson.build new file mode 100644 index 00000000..d9a59691 --- /dev/null +++ b/extensions/places-menu/meson.build @@ -0,0 +1,7 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) + +extension_sources += files('placeDisplay.js') diff --git a/extensions/screenshot-window-sizer/meson.build b/extensions/screenshot-window-sizer/meson.build new file mode 100644 index 00000000..585c02da --- /dev/null +++ b/extensions/screenshot-window-sizer/meson.build @@ -0,0 +1,7 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) + +extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml') diff --git a/extensions/user-theme/meson.build b/extensions/user-theme/meson.build new file mode 100644 index 00000000..585c02da --- /dev/null +++ b/extensions/user-theme/meson.build @@ -0,0 +1,7 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) + +extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml') diff --git a/extensions/window-list/meson.build b/extensions/window-list/meson.build new file mode 100644 index 00000000..b4aa4dba --- /dev/null +++ b/extensions/window-list/meson.build @@ -0,0 +1,12 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) + +extension_sources += files('prefs.js') +extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml') + +if classic_mode_enabled + extension_data += files('classic.css') +endif diff --git a/extensions/windowsNavigator/meson.build b/extensions/windowsNavigator/meson.build new file mode 100644 index 00000000..48504f63 --- /dev/null +++ b/extensions/windowsNavigator/meson.build @@ -0,0 +1,5 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) diff --git a/extensions/workspace-indicator/meson.build b/extensions/workspace-indicator/meson.build new file mode 100644 index 00000000..71efa039 --- /dev/null +++ b/extensions/workspace-indicator/meson.build @@ -0,0 +1,7 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) + +extension_sources += files('prefs.js') diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..80b1b184 --- /dev/null +++ b/meson.build @@ -0,0 +1,96 @@ +project('gnome-shell-extensions', + version: '3.27.1', + meson_version: '>= 0.37.0', + license: 'GPL2+' +) + +gettext_domain = meson.project_name() + +gnome = import('gnome') +i18n = import('i18n') + +datadir = get_option('datadir') + +shelldir = join_paths(datadir, 'gnome-shell') +extensiondir = join_paths(shelldir, 'extensions') +modedir = join_paths(shelldir, 'modes') +themedir = join_paths(shelldir, 'theme') + +schemadir = join_paths(datadir, 'glib-2.0', 'schemas') +sessiondir = join_paths(datadir, 'gnome-session', 'sessions') +xsessiondir = join_paths(datadir, 'xsession') + +extensionlib = files('lib/convenience.js') + +sassc = find_program('sassc', required: false) + +ver_arr = meson.project_version().split('.') +if ver_arr[1].to_int().is_even() + shell_version = '@0@.@1@'.format(ver_arr[0], ver_arr[1]) +else + shell_version = '.'.join(ver_arr) +endif + +classic_extensions = [ + 'alternate-tab', + 'apps-menu', + 'places-menu', + 'launch-new-instance', + 'window-list' +] + +default_extensions = classic_extensions +default_extensions += [ + 'drive-menu', + 'screenshot-window-sizer', + 'windowsNavigator', + 'workspace-indicator' +] + +all_extensions = default_extensions +all_extensions += [ + 'auto-move-windows', + 'example', + 'native-window-placement', + 'user-theme' +] + +enabled_extensions = get_option('enable_extensions').split() + +if enabled_extensions.length() == 0 + set = get_option('extension_set') + + if set == 'classic' + enabled_extensions += classic_extensions + elif set == 'default' + enabled_extensions += default_extensions + elif set == 'all' + enabled_extensions += all_extensions + endif +endif + +classic_mode_enabled = get_option('classic_mode') + +if classic_mode_enabled + # Sanity check: Make sure all classic extensions are enabled + foreach e : classic_extensions + if not enabled_extensions.contains(e) + error('Classic mode is enabled, ' + + 'but the required extension @0@ is not.'.format(e)) + endif + endforeach +endif + +# Sanity check: Make sure enabled extensions are valid +foreach e : enabled_extensions + if not all_extensions.contains(e) + error('Invalid extension @0@.'.format(e)) + endif +endforeach + +if classic_mode_enabled + subdir('data') +endif + +subdir('extensions') +subdir('po') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 00000000..5a157dfb --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,18 @@ +option('extension_set', + type: 'combo', + choices: ['classic', 'default', 'all'], + value: 'default', + description: 'Predefined sets of extensions' +) + +option('enable_extensions', + type: 'string', + value: '', + description: 'Space separated list of extensions to enable instead of a predefined set.' +) + +option('classic_mode', + type: 'boolean', + value: false, + description: 'Enable installing data files for classic mode.' +) diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 00000000..7f15404a --- /dev/null +++ b/po/meson.build @@ -0,0 +1 @@ +i18n.gettext(gettext_domain, preset: 'glib') From a2c63a46d3f7ca1c9f38798f9c3b581b6fc46f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 27 Apr 2017 17:02:56 +0200 Subject: [PATCH 23/60] build: Add utility script to export zip files We currently do have some Makefile magic to export zip files suitable for uploading to extensions.gnome.org. As this is not easily replicated in meson, add a small non-magic script for the same purpose. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/31 --- export-zips.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 export-zips.sh diff --git a/export-zips.sh b/export-zips.sh new file mode 100755 index 00000000..776c2541 --- /dev/null +++ b/export-zips.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +srcdir=`dirname $0` +srcdir=`(cd $srcdir && pwd)` + +builddir=`mktemp -p $srcdir -d _build.XXXXXX` || exit 1 +installdir=`mktemp -p $srcdir -d _install.XXXXXX` || exit 1 + +meson setup --prefix=$installdir -Dextension_set=all $srcdir $builddir +ninja -C$builddir install + +rm -rf $srcdir/zip-files +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%%@*}` + uuid=$name@gnome-shell-extensions.gcampax.github.com + schema=$schemadir/org.gnome.shell.extensions.$name.gschema.xml + + cp $srcdir/NEWS $srcdir/COPYING $f + + if [ -f $schema ]; then + mkdir $f/schemas + cp $schema $f/schemas; + glib-compile-schemas $f/schemas + fi + + (cd $f && zip -rmq $srcdir/zip-files/$uuid.shell-extension.zip .) +done + +rm -rf $builddir +rm -rf $installdir From 406f4cd170c7ca7133ef369567a2431bb5f6f1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 9 Apr 2017 06:09:04 +0200 Subject: [PATCH 24/60] docs: Update instructions for extension additions for meson The steps for adding a new extension are clearly different in meson, so update the instructions accordingly. Don't bother with keeping the existing autotools steps - supporting both build systems in parallel is just temporary, autotools is on its way out. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/31 --- HACKING.md | 14 +++++++------- extensions/meson.build.template | 8 ++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 extensions/meson.build.template diff --git a/HACKING.md b/HACKING.md index 217bd505..f8786287 100644 --- a/HACKING.md +++ b/HACKING.md @@ -1,13 +1,13 @@ ## Creating a New Extension -To create a new extension, add a subdirectory in extensions. -Then create a Makefile.am like the one in example, replacing -the EXTENSION_ID with the basename of your extension, which -must match the UUID in metadata.json. -If you need additional files, add them to EXTENSION_EXTRA. +To create a new extension, add a subdirectory in extensions. Then create +a meson.build from the provided [template](extensions/meson.build.template). +If you need additional sources, add them to extension_sources. Similarily add +GSettings schemas to extension_schemas and other files to extension_data. -Then modify extensions/Makefile.am and configure.ac. It should -be pretty self-explanatory. +Then modify the [toplevel Meson file](meson.build) to add the new +extension name in the appropriate set (that is one of classic_extensions, +default_extensions or all_extensions). Don't forget to add any translatable file to po/POTFILES.in, and then you're done. diff --git a/extensions/meson.build.template b/extensions/meson.build.template new file mode 100644 index 00000000..e83e528b --- /dev/null +++ b/extensions/meson.build.template @@ -0,0 +1,8 @@ +extension_data += configure_file( + input: metadata_name + '.in', + output: metadata_name, + configuration: metadata_conf +) + +# extension_sources += files('prefs.js') +# extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml') From ba380190499711ff092c66d831d131af26a14368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 29 Nov 2017 21:49:09 +0100 Subject: [PATCH 25/60] build: Remove autotools support Complete the switch to meson and drop autotools support ... Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/31 --- Makefile.am | 52 ---------- autogen.sh | 26 ----- config/.gitignore | 3 - configure.ac | 98 ------------------- data/Makefile.am | 73 -------------- extension.mk | 18 ---- extensions/Makefile.am | 3 - extensions/alternate-tab/Makefile.am | 5 - extensions/apps-menu/Makefile.am | 3 - extensions/auto-move-windows/Makefile.am | 7 -- extensions/drive-menu/Makefile.am | 3 - extensions/example/Makefile.am | 6 -- extensions/launch-new-instance/Makefile.am | 3 - .../native-window-placement/Makefile.am | 5 - extensions/places-menu/Makefile.am | 5 - .../screenshot-window-sizer/Makefile.am | 4 - extensions/user-theme/Makefile.am | 5 - extensions/window-list/Makefile.am | 10 -- extensions/windowsNavigator/Makefile.am | 3 - extensions/workspace-indicator/Makefile.am | 5 - include.mk | 12 --- m4/.gitignore | 1 - settings.mk | 9 -- 23 files changed, 359 deletions(-) delete mode 100644 Makefile.am delete mode 100755 autogen.sh delete mode 100644 config/.gitignore delete mode 100644 configure.ac delete mode 100644 data/Makefile.am delete mode 100644 extension.mk delete mode 100644 extensions/Makefile.am delete mode 100644 extensions/alternate-tab/Makefile.am delete mode 100644 extensions/apps-menu/Makefile.am delete mode 100644 extensions/auto-move-windows/Makefile.am delete mode 100644 extensions/drive-menu/Makefile.am delete mode 100644 extensions/example/Makefile.am delete mode 100644 extensions/launch-new-instance/Makefile.am delete mode 100644 extensions/native-window-placement/Makefile.am delete mode 100644 extensions/places-menu/Makefile.am delete mode 100644 extensions/screenshot-window-sizer/Makefile.am delete mode 100644 extensions/user-theme/Makefile.am delete mode 100644 extensions/window-list/Makefile.am delete mode 100644 extensions/windowsNavigator/Makefile.am delete mode 100644 extensions/workspace-indicator/Makefile.am delete mode 100644 include.mk delete mode 100644 m4/.gitignore delete mode 100644 settings.mk diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index f813a2d8..00000000 --- a/Makefile.am +++ /dev/null @@ -1,52 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} - -DIST_SUBDIRS = data extensions po - -SUBDIRS = extensions po - -if CLASSIC_MODE -SUBDIRS += data -endif - -EXTRA_DIST = lib/convenience.js - -DISTCHECK_CONFIGURE_FLAGS = --enable-extensions=all - -include include.mk - -zip-file: all - -rm -fR $(builddir)/_build - -rm -fR $(builddir)/zip-files - $(MKDIR_P) $(builddir)/_build; \ - $(MKDIR_P) $(builddir)/zip-files; \ - $(MAKE) install DESTDIR="$(abs_builddir)/_build"; \ - for i in $(ENABLED_EXTENSIONS); do \ - mv "$(builddir)/_build$(topextensiondir)/$${i}$(extensionbase)" "$(builddir)/_build/"; \ - cp -r "$(builddir)/_build$(datadir)/locale" "$(builddir)/_build/$${i}$(extensionbase)"; \ - cp "$(srcdir)/COPYING" -t "$(builddir)/_build/$${i}$(extensionbase)"; \ - cp "$(srcdir)/NEWS" -t "$(builddir)/_build/$${i}$(extensionbase)"; \ - if [ -f "$(builddir)/_build$(datadir)/glib-2.0/schemas/$(gschemabase).$${i}.gschema.xml" ]; then \ - $(MKDIR_P) "$(builddir)/_build/$${i}$(extensionbase)/schemas"; \ - mv "$(builddir)/_build$(datadir)/glib-2.0/schemas/$(gschemabase).$${i}.gschema.xml" "$(builddir)/_build/$${i}$(extensionbase)/schemas"; \ - glib-compile-schemas "$(builddir)/_build/$${i}$(extensionbase)/schemas"; \ - fi; \ - (cd "$(builddir)/_build/$${i}$(extensionbase)"; \ - zip -qr "$(abs_builddir)/zip-files/$${i}$(extensionbase).shell-extension.zip" .; \ - ); \ - done - -rm -fR $(builddir)/_build - -localprefix = $(HOME)/.local/share/gnome-shell/extensions - -local-install: zip-file - for i in $(ENABLED_EXTENSIONS); do \ - uuid="$${i}$(extensionbase)"; \ - zip_file="$(abs_builddir)/zip-files/$${uuid}.shell-extension.zip"; \ - if [ -d "$(localprefix)/$${uuid}" ]; then \ - rm -fR "$(localprefix)/$${uuid}"; \ - fi; \ - $(MKDIR_P) $(localprefix)/$${uuid}; \ - (cd $(localprefix)/$${uuid}; \ - unzip -q $${zip_file}; \ - ); \ - done diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 8edabd23..00000000 --- a/autogen.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -test -f $srcdir/configure.ac || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level gnome-shell-extensions directory" - exit 1 -} - -# Fetch submodules if needed -if test ! -f data/gnome-shell-sass/COPYING; -then - echo "+ Setting up submodules" - git submodule init -fi -git submodule update - -which gnome-autogen.sh || { - echo "You need to install gnome-common from GNOME Git (or from" - echo "your OS vendor's package manager)." - exit 1 -} -. gnome-autogen.sh diff --git a/config/.gitignore b/config/.gitignore deleted file mode 100644 index 7e97b48a..00000000 --- a/config/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -install-sh -mkinstalldirs -missing diff --git a/configure.ac b/configure.ac deleted file mode 100644 index a6a1ced9..00000000 --- a/configure.ac +++ /dev/null @@ -1,98 +0,0 @@ -AC_PREREQ(2.63) -AC_INIT([gnome-shell-extensions],[3.27.1],[https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues]) - -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_AUX_DIR([config]) - -AM_INIT_AUTOMAKE([1.10 dist-xz no-dist-gzip foreign tar-ustar]) - -m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) - -GETTEXT_PACKAGE=gnome-shell-extensions -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", - [The prefix for our gettext translation domains.]) - -AM_GNU_GETTEXT_VERSION([0.19.6]) -AM_GNU_GETTEXT([external]) - -PKG_PROG_PKG_CONFIG([0.22]) - -GLIB_GSETTINGS - -SHELL_VERSION="$PACKAGE_VERSION" -shell_major=`echo "$PACKAGE_VERSION" | cut -d'.' -f1` -shell_minor=`echo "$PACKAGE_VERSION" | cut -d'.' -f2` -if test "$(($shell_minor % 2))" -eq 0; then - SHELL_VERSION="$shell_major.$shell_minor" -fi -AC_SUBST([SHELL_VERSION]) - -dnl keep this in alphabetic order -CLASSIC_EXTENSIONS="apps-menu places-menu alternate-tab launch-new-instance window-list" -DEFAULT_EXTENSIONS="$CLASSIC_EXTENSIONS drive-menu screenshot-window-sizer windowsNavigator workspace-indicator" -ALL_EXTENSIONS="$DEFAULT_EXTENSIONS auto-move-windows example native-window-placement user-theme" -AC_SUBST(CLASSIC_EXTENSIONS, [$CLASSIC_EXTENSIONS]) -AC_SUBST(ALL_EXTENSIONS, [$ALL_EXTENSIONS]) -AC_ARG_ENABLE([extensions], - [AS_HELP_STRING([--enable-extensions],[Space separated list of extensions to enable. - The default is to build and distribute all extensions that can be installed in the home directory and have no external depedencies. - Use "all" to enable all available extensions, or "classic-mode" to enable extensions that restore GNOME 2 functionality.])], - [], - [enable_extensions=$DEFAULT_EXTENSIONS] -) - -if test x"$enable_extensions" = xall; then - enable_extensions="$ALL_EXTENSIONS" - enable_classic_mode_default=yes -elif test x"$enable_extensions" = xclassic-mode; then - enable_extensions="$CLASSIC_EXTENSIONS" - enable_classic_mode_default=yes -else - enable_classic_mode_default=no -fi - -AC_ARG_ENABLE([classic-mode], - [AS_HELP_STRING([--enable-classic-mode],[Enable installing data files for classic mode. - Defaults to yes if enabling all or classic-mode extensions, and no otherwise.])], - [], - [enable_classic_mode=$enable_classic_mode_default]) -AM_CONDITIONAL([CLASSIC_MODE], [test x"$enable_classic_mode" != xno]) - -ENABLED_EXTENSIONS= -for e in $enable_extensions; do - case $e in -dnl keep this in alphabetic order - alternate-tab|apps-menu|auto-move-windows|drive-menu|example|launch-new-instance|native-window-placement|places-menu|screenshot-window-sizer|user-theme|window-list|windowsNavigator|workspace-indicator) - ENABLED_EXTENSIONS="$ENABLED_EXTENSIONS $e" - ;; - *) - AC_MSG_ERROR([invalid extension $e]) - esac -done - -AC_SUBST(ENABLED_EXTENSIONS, [$ENABLED_EXTENSIONS]) - -AC_PATH_PROG([SASSC],[sassc],[]) - -dnl Please keep this sorted alphabetically -AC_CONFIG_FILES([ - data/Makefile - extensions/alternate-tab/Makefile - extensions/apps-menu/Makefile - extensions/auto-move-windows/Makefile - extensions/drive-menu/Makefile - extensions/example/Makefile - extensions/launch-new-instance/Makefile - extensions/native-window-placement/Makefile - extensions/places-menu/Makefile - extensions/screenshot-window-sizer/Makefile - extensions/user-theme/Makefile - extensions/window-list/Makefile - extensions/windowsNavigator/Makefile - extensions/workspace-indicator/Makefile - extensions/Makefile - Makefile - po/Makefile.in -]) -AC_OUTPUT diff --git a/data/Makefile.am b/data/Makefile.am deleted file mode 100644 index fd24eff4..00000000 --- a/data/Makefile.am +++ /dev/null @@ -1,73 +0,0 @@ -include $(top_srcdir)/include.mk - -sessiondir = $(datadir)/gnome-session/sessions -session_in_files = gnome-classic.session.desktop.in -session_DATA = $(session_in_files:.session.desktop.in=.session) - -xsessiondir = $(datadir)/xsessions -xsession_in_files = gnome-classic.desktop.in -xsession_DATA = $(xsession_in_files:.desktop.in=.desktop) - -modedir = $(datadir)/gnome-shell/modes -mode_in_files = classic.json.in -mode_DATA = $(mode_in_files:.json.in=.json) - -themedir = $(datadir)/gnome-shell/theme -theme_DATA = \ - $(srcdir)/calendar-today.svg \ - $(srcdir)/classic-process-working.svg \ - $(srcdir)/classic-toggle-off-intl.svg \ - $(srcdir)/classic-toggle-off-us.svg \ - $(srcdir)/classic-toggle-on-intl.svg \ - $(srcdir)/classic-toggle-on-us.svg \ - $(srcdir)/gnome-classic.css \ - $(srcdir)/gnome-classic-high-contrast.css \ - $(NULL) - -theme_sources = \ - $(srcdir)/gnome-classic.scss \ - $(srcdir)/gnome-shell-sass/_colors.scss \ - $(srcdir)/gnome-shell-sass/_common.scss \ - $(srcdir)/gnome-shell-sass/_drawing.scss \ - $(srcdir)/gnome-shell-sass/_high-contrast-colors.scss \ - $(NULL) - -%.css: %.scss $(theme_sources) - @if test -n "$(SASSC)"; then \ - if $(AM_V_P); then PS4= set -x; else echo " GEN $@"; fi; \ - $(SASSC) -a $< $@; \ - fi - -gsettings_SCHEMAS = org.gnome.shell.extensions.classic-overrides.gschema.xml - -@GSETTINGS_RULES@ - -%.desktop:%.desktop.in - $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ - -%.session: %.session.desktop.in - $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ - -comma:=, -empty:= -space:= $(empty) $(empty) -extensions:=$(patsubst %,\"%$(extensionbase)\",$(CLASSIC_EXTENSIONS)) -extension_list:=$(subst $(space),$(comma),$(extensions)) -%.json:%.json.in - $(AM_V_GEN) sed \ - -e "s|\@CLASSIC_EXTENSIONS\@|$(extension_list)|g" \ - $< > $@ - -EXTRA_DIST = \ - $(session_in_files) \ - $(xsession_in_files) \ - $(mode_in_files) \ - $(gsettings_SCHEMAS) \ - $(theme_DATA) \ - $(NULL) - -CLEANFILES = \ - $(session_DATA) \ - $(xsession_DATA) \ - $(mode_DATA) \ - $(NULL) diff --git a/extension.mk b/extension.mk deleted file mode 100644 index 1a84f60c..00000000 --- a/extension.mk +++ /dev/null @@ -1,18 +0,0 @@ -include $(top_srcdir)/include.mk - -dist_extension_DATA = extension.js stylesheet.css $(EXTRA_MODULES) -nodist_extension_DATA = metadata.json $(top_srcdir)/lib/convenience.js $(EXTRA_EXTENSION) - -EXTRA_DIST = metadata.json.in - -metadata.json: metadata.json.in $(top_builddir)/config.status - $(AM_V_GEN) sed \ - -e "s|[@]extension_id@|$(EXTENSION_ID)|" \ - -e "s|[@]uuid@|$(uuid)|" \ - -e "s|[@]gschemaname@|$(gschemaname)|" \ - -e "s|[@]gettext_domain@|$(GETTEXT_PACKAGE)|" \ - -e "s|[@]shell_current@|$(SHELL_VERSION)|" \ - -e "s|[@]url@|$(extensionurl)|" \ - $< > $@ - -CLEANFILES = metadata.json diff --git a/extensions/Makefile.am b/extensions/Makefile.am deleted file mode 100644 index 4e8c55a1..00000000 --- a/extensions/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -DIST_SUBDIRS = $(ALL_EXTENSIONS) - -SUBDIRS = $(ENABLED_EXTENSIONS) diff --git a/extensions/alternate-tab/Makefile.am b/extensions/alternate-tab/Makefile.am deleted file mode 100644 index 56bc74b2..00000000 --- a/extensions/alternate-tab/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -EXTENSION_ID = alternate-tab - -EXTRA_MODULES = prefs.js - -include ../../extension.mk diff --git a/extensions/apps-menu/Makefile.am b/extensions/apps-menu/Makefile.am deleted file mode 100644 index 86431d7b..00000000 --- a/extensions/apps-menu/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -EXTENSION_ID = apps-menu - -include ../../extension.mk diff --git a/extensions/auto-move-windows/Makefile.am b/extensions/auto-move-windows/Makefile.am deleted file mode 100644 index 9fe652dc..00000000 --- a/extensions/auto-move-windows/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -EXTENSION_ID = auto-move-windows - -EXTRA_MODULES = prefs.js - -include ../../extension.mk -include ../../settings.mk - diff --git a/extensions/drive-menu/Makefile.am b/extensions/drive-menu/Makefile.am deleted file mode 100644 index af904712..00000000 --- a/extensions/drive-menu/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -EXTENSION_ID = drive-menu - -include ../../extension.mk diff --git a/extensions/example/Makefile.am b/extensions/example/Makefile.am deleted file mode 100644 index 3b2d3e10..00000000 --- a/extensions/example/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -EXTENSION_ID = example - -EXTRA_MODULES = prefs.js - -include ../../extension.mk -include ../../settings.mk diff --git a/extensions/launch-new-instance/Makefile.am b/extensions/launch-new-instance/Makefile.am deleted file mode 100644 index fe316006..00000000 --- a/extensions/launch-new-instance/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -EXTENSION_ID = launch-new-instance - -include ../../extension.mk diff --git a/extensions/native-window-placement/Makefile.am b/extensions/native-window-placement/Makefile.am deleted file mode 100644 index 93694a32..00000000 --- a/extensions/native-window-placement/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -EXTENSION_ID = native-window-placement - -include ../../extension.mk -include ../../settings.mk - diff --git a/extensions/places-menu/Makefile.am b/extensions/places-menu/Makefile.am deleted file mode 100644 index 7096386e..00000000 --- a/extensions/places-menu/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -EXTENSION_ID = places-menu - -EXTRA_MODULES = placeDisplay.js - -include ../../extension.mk diff --git a/extensions/screenshot-window-sizer/Makefile.am b/extensions/screenshot-window-sizer/Makefile.am deleted file mode 100644 index a3e1dfd8..00000000 --- a/extensions/screenshot-window-sizer/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -EXTENSION_ID = screenshot-window-sizer - -include ../../extension.mk -include ../../settings.mk diff --git a/extensions/user-theme/Makefile.am b/extensions/user-theme/Makefile.am deleted file mode 100644 index 5124912f..00000000 --- a/extensions/user-theme/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -EXTENSION_ID = user-theme - -include ../../extension.mk -include ../../settings.mk - diff --git a/extensions/window-list/Makefile.am b/extensions/window-list/Makefile.am deleted file mode 100644 index cd3e03bc..00000000 --- a/extensions/window-list/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -EXTENSION_ID = window-list - -EXTRA_MODULES = prefs.js - -if CLASSIC_MODE - EXTRA_MODULES += classic.css -endif - -include ../../extension.mk -include ../../settings.mk diff --git a/extensions/windowsNavigator/Makefile.am b/extensions/windowsNavigator/Makefile.am deleted file mode 100644 index adeb886b..00000000 --- a/extensions/windowsNavigator/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -EXTENSION_ID = windowsNavigator - -include ../../extension.mk diff --git a/extensions/workspace-indicator/Makefile.am b/extensions/workspace-indicator/Makefile.am deleted file mode 100644 index 66201163..00000000 --- a/extensions/workspace-indicator/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -EXTENSION_ID = workspace-indicator - -EXTRA_MODULES = prefs.js - -include ../../extension.mk diff --git a/include.mk b/include.mk deleted file mode 100644 index 3ab665f9..00000000 --- a/include.mk +++ /dev/null @@ -1,12 +0,0 @@ -extensionurl = https://gitlab.gnome.org/GNOME/gnome-shell-extensions - -# Change these to modify how installation is performed -topextensiondir = $(datadir)/gnome-shell/extensions -extensionbase = @gnome-shell-extensions.gcampax.github.com - -gschemabase = org.gnome.shell.extensions - -uuid = $(EXTENSION_ID)$(extensionbase) -gschemaname = $(gschemabase).$(EXTENSION_ID) - -extensiondir = $(topextensiondir)/$(uuid) diff --git a/m4/.gitignore b/m4/.gitignore deleted file mode 100644 index 9f841b0a..00000000 --- a/m4/.gitignore +++ /dev/null @@ -1 +0,0 @@ -intltool.m4 diff --git a/settings.mk b/settings.mk deleted file mode 100644 index e1f8bb96..00000000 --- a/settings.mk +++ /dev/null @@ -1,9 +0,0 @@ -gsettings_SCHEMAS = $(gschemaname).gschema.xml - -%.desktop:%.desktop.in - $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ - -@GSETTINGS_RULES@ - -CLEANFILES += $(gsettings_SCHEMAS:.xml=.valid) -EXTRA_DIST += $(gsettings_SCHEMAS) From b90c99b87c3682b073a9b7481f7e657395e01a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 29 Nov 2017 22:00:14 +0100 Subject: [PATCH 26/60] build: Optionally syntax-check sources As a pure javascript project, building is really just a glorified copy operation, so success doesn't even indicate that sources are syntactically correct (a.k.a. "compile-tested"). We can at least get some minimal testing by performing some basic syntax checking when SpilderMonkey's JS shell is available. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/32 --- extensions/meson.build | 25 +++++++++++++++++++++---- meson.build | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/extensions/meson.build b/extensions/meson.build index 30bc053f..eba5053c 100644 --- a/extensions/meson.build +++ b/extensions/meson.build @@ -1,8 +1,9 @@ extension_schemas = [] +js_sources = extensionlib metadata_name = 'metadata.json' -foreach e : enabled_extensions +foreach e : all_extensions uuid = e + '@gnome-shell-extensions.gcampax.github.com' metadata_conf = configuration_data() @@ -18,11 +19,27 @@ foreach e : enabled_extensions subdir(e) - install_data (extension_sources + extension_data + extensionlib, - install_dir: join_paths(extensiondir, uuid) - ) + js_sources += extension_sources + + if (enabled_extensions.contains(e)) + install_data (extension_sources + extension_data + extensionlib, + install_dir: join_paths(extensiondir, uuid) + ) + endif endforeach install_data (extension_schemas, install_dir: schemadir ) + +foreach js_source : js_sources + if (js52.found()) + path_array = '@0@'.format(js_source).split('/') + name = join_paths(path_array[-2], path_array[-1]) + + test('Checking syntax of ' + name, js52, + args: ['-s', '-c', js_source], + workdir: meson.current_source_dir() + ) + endif +endforeach diff --git a/meson.build b/meson.build index 80b1b184..92cf3718 100644 --- a/meson.build +++ b/meson.build @@ -22,6 +22,7 @@ xsessiondir = join_paths(datadir, 'xsession') extensionlib = files('lib/convenience.js') +js52 = find_program('js52', required: false) sassc = find_program('sassc', required: false) ver_arr = meson.project_version().split('.') From 9d5b1494288b7801c8add18e83114ba11e12e433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 1 Dec 2017 00:14:41 +0100 Subject: [PATCH 27/60] ci: Add initial gitlab continuous integration Continuous integration is good, in particular when used before merging a change to master as allowed by gitlab. And now that we enabled some basic syntax checking of source files, we even have something useful to test for ... Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/32 --- .gitlab-ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..37316972 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,13 @@ +image: fedora:rawhide + +stages: + - build + +before_script: + - dnf install -y meson gettext gjs-devel + +build-shell-extensions: + stage: build + script: + - meson _build . + - ninja -C _build test install From d3bbeb1b0c8467be8722110f31aecdfe7df4119c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 27 Oct 2017 17:37:31 +0200 Subject: [PATCH 28/60] cleanup: Fix some coding style issues Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30 --- extensions/alternate-tab/prefs.js | 2 +- extensions/example/extension.js | 2 +- extensions/places-menu/placeDisplay.js | 12 ++++++------ extensions/window-list/extension.js | 3 +-- extensions/workspace-indicator/extension.js | 10 +++++----- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/extensions/alternate-tab/prefs.js b/extensions/alternate-tab/prefs.js index 864ea362..2828c4ff 100644 --- a/extensions/alternate-tab/prefs.js +++ b/extensions/alternate-tab/prefs.js @@ -27,7 +27,7 @@ const AltTabSettingsWidget = new GObject.Class({ GTypeName: 'AltTabSettingsWidget', Extends: Gtk.Grid, - _init : function(params) { + _init: function(params) { this.parent(params); this.margin = 24; this.row_spacing = 6; diff --git a/extensions/example/extension.js b/extensions/example/extension.js index d2de6f4c..752b3737 100644 --- a/extensions/example/extension.js +++ b/extensions/example/extension.js @@ -20,7 +20,7 @@ function _showHello() { let monitor = Main.layoutManager.primaryMonitor; global.stage.add_actor(label); label.set_position(Math.floor (monitor.width / 2 - label.width / 2), Math.floor(monitor.height / 2 - label.height / 2)); - Mainloop.timeout_add(3000, function () { label.destroy(); }); + Mainloop.timeout_add(3000, function() { label.destroy(); }); } // Put your extension initialization code here diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index 34c594e8..bf7372ac 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -290,11 +290,11 @@ var PlacesManager = new Lang.Class({ if (this._bookmarksFile) { this._monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null); - this._monitor.connect('changed', Lang.bind(this, function () { + this._monitor.connect('changed', Lang.bind(this, function() { if (this._bookmarkTimeoutId > 0) return; /* Defensive event compression */ - this._bookmarkTimeoutId = Mainloop.timeout_add(100, Lang.bind(this, function () { + this._bookmarkTimeoutId = Mainloop.timeout_add(100, Lang.bind(this, function() { this._bookmarkTimeoutId = 0; this._reloadBookmarks(); return false; @@ -333,7 +333,7 @@ var PlacesManager = new Lang.Class({ }, _updateSpecials: function() { - this._places.special.forEach(function (p) { p.destroy(); }); + this._places.special.forEach(function(p) { p.destroy(); }); this._places.special = []; let homePath = GLib.get_home_dir(); @@ -375,9 +375,9 @@ var PlacesManager = new Lang.Class({ let networkMounts = []; let networkVolumes = []; - this._places.devices.forEach(function (p) { p.destroy(); }); + this._places.devices.forEach(function(p) { p.destroy(); }); this._places.devices = []; - this._places.network.forEach(function (p) { p.destroy(); }); + this._places.network.forEach(function(p) { p.destroy(); }); this._places.network = []; /* Add standard places */ @@ -542,7 +542,7 @@ var PlacesManager = new Lang.Class({ this._places[kind].push(volItem); }, - get: function (kind) { + get: function(kind) { return this._places[kind]; } }); diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index f01b8727..b0051550 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -573,7 +573,6 @@ const AppButton = new Lang.Class({ }); }, - getWindowList: function() { return this.app.get_windows().filter(Lang.bind(this, function(win) { return this._isWindowVisible(win); @@ -674,7 +673,7 @@ const WorkspaceIndicator = new Lang.Class({ Name: 'WindowList.WorkspaceIndicator', Extends: PanelMenu.Button, - _init: function(){ + _init: function() { this.parent(0.0, _("Workspace Indicator"), true); this.setMenu(new PopupMenu.PopupMenu(this.actor, 0.0, St.Side.BOTTOM)); this.actor.add_style_class_name('window-list-workspace-indicator'); diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index af0b7cac..37a3a08d 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -26,7 +26,7 @@ const WorkspaceIndicator = new Lang.Class({ Name: 'WorkspaceIndicator.WorkspaceIndicator', Extends: PanelMenu.Button, - _init: function(){ + _init: function() { this.parent(0.0, _("Workspace Indicator")); this._currentWorkspace = global.screen.get_active_workspace().index(); @@ -74,7 +74,7 @@ const WorkspaceIndicator = new Lang.Class({ this.statusLabel.set_text(this._labelText()); }, - _labelText : function(workspaceIndex) { + _labelText: function(workspaceIndex) { if(workspaceIndex == undefined) { workspaceIndex = this._currentWorkspace; return (workspaceIndex + 1).toString(); @@ -82,7 +82,7 @@ const WorkspaceIndicator = new Lang.Class({ return Meta.prefs_get_workspace_name(workspaceIndex); }, - _createWorkspacesSection : function() { + _createWorkspacesSection: function() { this._workspaceSection.removeAll(); this.workspacesItems = []; this._currentWorkspace = global.screen.get_active_workspace().index(); @@ -105,14 +105,14 @@ const WorkspaceIndicator = new Lang.Class({ this.statusLabel.set_text(this._labelText()); }, - _activate : function (index) { + _activate: function(index) { if(index >= 0 && index < global.screen.n_workspaces) { let metaWorkspace = global.screen.get_workspace_by_index(index); metaWorkspace.activate(global.get_current_time()); } }, - _onScrollEvent : function(actor, event) { + _onScrollEvent: function(actor, event) { let direction = event.get_scroll_direction(); let diff = 0; if (direction == Clutter.ScrollDirection.DOWN) { From 4ee30a54454d787f8c9f59b55a4f0b3b94267aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 27 Oct 2017 17:44:46 +0200 Subject: [PATCH 29/60] cleanup: Replace tabs with spaces Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30 --- extensions/alternate-tab/prefs.js | 10 +- extensions/auto-move-windows/extension.js | 12 +- extensions/auto-move-windows/prefs.js | 264 ++++++++++---------- extensions/drive-menu/extension.js | 136 +++++----- extensions/example/extension.js | 4 +- extensions/example/prefs.js | 16 +- extensions/places-menu/extension.js | 40 +-- extensions/workspace-indicator/extension.js | 118 ++++----- 8 files changed, 300 insertions(+), 300 deletions(-) diff --git a/extensions/alternate-tab/prefs.js b/extensions/alternate-tab/prefs.js index 2828c4ff..b8c42007 100644 --- a/extensions/alternate-tab/prefs.js +++ b/extensions/alternate-tab/prefs.js @@ -31,7 +31,7 @@ const AltTabSettingsWidget = new GObject.Class({ this.parent(params); this.margin = 24; this.row_spacing = 6; - this.orientation = Gtk.Orientation.VERTICAL; + this.orientation = Gtk.Orientation.VERTICAL; this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.window-switcher' }); @@ -66,10 +66,10 @@ const AltTabSettingsWidget = new GObject.Class({ radio.active = true; } - let check = new Gtk.CheckButton({ label: _("Show only windows in the current workspace"), - margin_top: 6 }); - this._settings.bind(SETTINGS_CURRENT_WORKSPACE_ONLY, check, 'active', Gio.SettingsBindFlags.DEFAULT); - this.add(check); + let check = new Gtk.CheckButton({ label: _("Show only windows in the current workspace"), + margin_top: 6 }); + this._settings.bind(SETTINGS_CURRENT_WORKSPACE_ONLY, check, 'active', Gio.SettingsBindFlags.DEFAULT); + this.add(check); }, }); diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index e4c7fcae..05e6321a 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -117,19 +117,19 @@ function myCheckWorkspaces() { let windows = global.get_window_actors(); for (i = 0; i < windows.length; i++) { - let winActor = windows[i]; + let winActor = windows[i]; let win = winActor.meta_window; - if (win.is_on_all_workspaces()) + if (win.is_on_all_workspaces()) continue; - let workspaceIndex = win.get_workspace().index(); - emptyWorkspaces[workspaceIndex] = false; + let workspaceIndex = win.get_workspace().index(); + emptyWorkspaces[workspaceIndex] = false; } // If we don't have an empty workspace at the end, add one if (!emptyWorkspaces[emptyWorkspaces.length -1]) { - global.screen.append_new_workspace(false, global.get_current_time()); - emptyWorkspaces.push(false); + global.screen.append_new_workspace(false, global.get_current_time()); + emptyWorkspaces.push(false); } let activeWorkspaceIndex = global.screen.get_active_workspace_index(); diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index 31f4c9ea..ebed660f 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -32,15 +32,15 @@ const Widget = new GObject.Class({ Extends: Gtk.Grid, _init: function(params) { - this.parent(params); + this.parent(params); this.set_orientation(Gtk.Orientation.VERTICAL); - this._settings = Convenience.getSettings(); - this._settings.connect('changed', Lang.bind(this, this._refresh)); - this._changedPermitted = false; + this._settings = Convenience.getSettings(); + this._settings.connect('changed', Lang.bind(this, this._refresh)); + this._changedPermitted = false; - this._store = new Gtk.ListStore(); - this._store.set_column_types([Gio.AppInfo, GObject.TYPE_STRING, Gio.Icon, GObject.TYPE_INT, + this._store = new Gtk.ListStore(); + this._store.set_column_types([Gio.AppInfo, GObject.TYPE_STRING, Gio.Icon, GObject.TYPE_INT, Gtk.Adjustment]); let scrolled = new Gtk.ScrolledWindow({ shadow_type: Gtk.ShadowType.IN}); @@ -48,44 +48,44 @@ const Widget = new GObject.Class({ this.add(scrolled); - this._treeView = new Gtk.TreeView({ model: this._store, + this._treeView = new Gtk.TreeView({ model: this._store, hexpand: true, vexpand: true }); - this._treeView.get_selection().set_mode(Gtk.SelectionMode.SINGLE); + this._treeView.get_selection().set_mode(Gtk.SelectionMode.SINGLE); - let appColumn = new Gtk.TreeViewColumn({ expand: true, sort_column_id: Columns.DISPLAY_NAME, - title: _("Application") }); - let iconRenderer = new Gtk.CellRendererPixbuf; - appColumn.pack_start(iconRenderer, false); - appColumn.add_attribute(iconRenderer, "gicon", Columns.ICON); - let nameRenderer = new Gtk.CellRendererText; - appColumn.pack_start(nameRenderer, true); - appColumn.add_attribute(nameRenderer, "text", Columns.DISPLAY_NAME); - this._treeView.append_column(appColumn); + let appColumn = new Gtk.TreeViewColumn({ expand: true, sort_column_id: Columns.DISPLAY_NAME, + title: _("Application") }); + let iconRenderer = new Gtk.CellRendererPixbuf; + appColumn.pack_start(iconRenderer, false); + appColumn.add_attribute(iconRenderer, "gicon", Columns.ICON); + let nameRenderer = new Gtk.CellRendererText; + appColumn.pack_start(nameRenderer, true); + appColumn.add_attribute(nameRenderer, "text", Columns.DISPLAY_NAME); + this._treeView.append_column(appColumn); - let workspaceColumn = new Gtk.TreeViewColumn({ title: _("Workspace"), + let workspaceColumn = new Gtk.TreeViewColumn({ title: _("Workspace"), sort_column_id: Columns.WORKSPACE }); - let workspaceRenderer = new Gtk.CellRendererSpin({ editable: true }); - workspaceRenderer.connect('edited', Lang.bind(this, this._workspaceEdited)); - workspaceColumn.pack_start(workspaceRenderer, true); - workspaceColumn.add_attribute(workspaceRenderer, "adjustment", Columns.ADJUSTMENT); + let workspaceRenderer = new Gtk.CellRendererSpin({ editable: true }); + workspaceRenderer.connect('edited', Lang.bind(this, this._workspaceEdited)); + workspaceColumn.pack_start(workspaceRenderer, true); + workspaceColumn.add_attribute(workspaceRenderer, "adjustment", Columns.ADJUSTMENT); workspaceColumn.add_attribute(workspaceRenderer, "text", Columns.WORKSPACE); - this._treeView.append_column(workspaceColumn); + this._treeView.append_column(workspaceColumn); - scrolled.add(this._treeView); + scrolled.add(this._treeView); - let toolbar = new Gtk.Toolbar({ icon_size: Gtk.IconSize.SMALL_TOOLBAR }); - toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR); - this.add(toolbar); + let toolbar = new Gtk.Toolbar({ icon_size: Gtk.IconSize.SMALL_TOOLBAR }); + toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR); + this.add(toolbar); - let newButton = new Gtk.ToolButton({ icon_name: 'bookmark-new-symbolic', + let newButton = new Gtk.ToolButton({ icon_name: 'bookmark-new-symbolic', label: _("Add Rule"), - is_important: true }); - newButton.connect('clicked', Lang.bind(this, this._createNew)); - toolbar.add(newButton); + is_important: true }); + newButton.connect('clicked', Lang.bind(this, this._createNew)); + toolbar.add(newButton); - let delButton = new Gtk.ToolButton({ icon_name: 'edit-delete-symbolic' }); - delButton.connect('clicked', Lang.bind(this, this._deleteSelected)); - toolbar.add(delButton); + let delButton = new Gtk.ToolButton({ icon_name: 'edit-delete-symbolic' }); + delButton.connect('clicked', Lang.bind(this, this._deleteSelected)); + toolbar.add(delButton); let selection = this._treeView.get_selection(); selection.connect('changed', @@ -94,23 +94,23 @@ const Widget = new GObject.Class({ }); delButton.sensitive = selection.count_selected_rows() > 0; - this._changedPermitted = true; - this._refresh(); + this._changedPermitted = true; + this._refresh(); }, _createNew: function() { - let dialog = new Gtk.Dialog({ title: _("Create new matching rule"), - transient_for: this.get_toplevel(), + let dialog = new Gtk.Dialog({ title: _("Create new matching rule"), + transient_for: this.get_toplevel(), use_header_bar: true, - modal: true }); - dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL); - let addButton = dialog.add_button(_("Add"), Gtk.ResponseType.OK); + modal: true }); + dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL); + let addButton = dialog.add_button(_("Add"), Gtk.ResponseType.OK); dialog.set_default_response(Gtk.ResponseType.OK); - let grid = new Gtk.Grid({ column_spacing: 10, + let grid = new Gtk.Grid({ column_spacing: 10, row_spacing: 15, margin: 10 }); - dialog._appChooser = new Gtk.AppChooserWidget({ show_all: true }); + dialog._appChooser = new Gtk.AppChooserWidget({ show_all: true }); dialog._appChooser.connect('application-selected', Lang.bind(this, function(w, appInfo) { addButton.sensitive = appInfo && @@ -119,105 +119,105 @@ const Widget = new GObject.Class({ let appInfo = dialog._appChooser.get_app_info(); addButton.sensitive = appInfo && this._checkId(appInfo.get_id()); - grid.attach(dialog._appChooser, 0, 0, 2, 1); - grid.attach(new Gtk.Label({ label: _("Workspace"), + grid.attach(dialog._appChooser, 0, 0, 2, 1); + grid.attach(new Gtk.Label({ label: _("Workspace"), halign: Gtk.Align.END }), 0, 1, 1, 1); - let adjustment = new Gtk.Adjustment({ lower: 1, - upper: WORKSPACE_MAX, - step_increment: 1 + let adjustment = new Gtk.Adjustment({ lower: 1, + upper: WORKSPACE_MAX, + step_increment: 1 }); - dialog._spin = new Gtk.SpinButton({ adjustment: adjustment, - snap_to_ticks: true }); + dialog._spin = new Gtk.SpinButton({ adjustment: adjustment, + snap_to_ticks: true }); dialog._spin.set_value(1); - grid.attach(dialog._spin, 1, 1, 1, 1); - dialog.get_content_area().add(grid); + grid.attach(dialog._spin, 1, 1, 1, 1); + dialog.get_content_area().add(grid); - dialog.connect('response', Lang.bind(this, function(dialog, id) { - if (id != Gtk.ResponseType.OK) { + dialog.connect('response', Lang.bind(this, function(dialog, id) { + if (id != Gtk.ResponseType.OK) { dialog.destroy(); - return; + return; } - let appInfo = dialog._appChooser.get_app_info(); - if (!appInfo) - return; - let index = Math.floor(dialog._spin.value); - if (isNaN(index) || index < 0) - index = 1; + let appInfo = dialog._appChooser.get_app_info(); + if (!appInfo) + return; + let index = Math.floor(dialog._spin.value); + if (isNaN(index) || index < 0) + index = 1; - this._changedPermitted = false; - this._appendItem(appInfo.get_id(), index); - this._changedPermitted = true; + this._changedPermitted = false; + this._appendItem(appInfo.get_id(), index); + this._changedPermitted = true; - let iter = this._store.append(); - let adj = new Gtk.Adjustment({ lower: 1, - upper: WORKSPACE_MAX, - step_increment: 1, + let iter = this._store.append(); + let adj = new Gtk.Adjustment({ lower: 1, + upper: WORKSPACE_MAX, + step_increment: 1, value: index }); - this._store.set(iter, - [Columns.APPINFO, Columns.ICON, Columns.DISPLAY_NAME, Columns.WORKSPACE, Columns.ADJUSTMENT], - [appInfo, appInfo.get_icon(), appInfo.get_display_name(), index, adj]); + this._store.set(iter, + [Columns.APPINFO, Columns.ICON, Columns.DISPLAY_NAME, Columns.WORKSPACE, Columns.ADJUSTMENT], + [appInfo, appInfo.get_icon(), appInfo.get_display_name(), index, adj]); dialog.destroy(); - })); - dialog.show_all(); + })); + dialog.show_all(); }, _deleteSelected: function() { - let [any, model, iter] = this._treeView.get_selection().get_selected(); + let [any, model, iter] = this._treeView.get_selection().get_selected(); - if (any) { - let appInfo = this._store.get_value(iter, Columns.APPINFO); + if (any) { + let appInfo = this._store.get_value(iter, Columns.APPINFO); - this._changedPermitted = false; - this._removeItem(appInfo.get_id()); - this._changedPermitted = true; - this._store.remove(iter); - } + this._changedPermitted = false; + this._removeItem(appInfo.get_id()); + this._changedPermitted = true; + this._store.remove(iter); + } }, _workspaceEdited: function(renderer, pathString, text) { - let index = parseInt(text); - if (isNaN(index) || index < 0) - index = 1; + let index = parseInt(text); + if (isNaN(index) || index < 0) + index = 1; let path = Gtk.TreePath.new_from_string(pathString); - let [model, iter] = this._store.get_iter(path); - let appInfo = this._store.get_value(iter, Columns.APPINFO); + let [model, iter] = this._store.get_iter(path); + let appInfo = this._store.get_value(iter, Columns.APPINFO); - this._changedPermitted = false; - this._changeItem(appInfo.get_id(), index); - this._store.set_value(iter, Columns.WORKSPACE, index); - this._changedPermitted = true; + this._changedPermitted = false; + this._changeItem(appInfo.get_id(), index); + this._store.set_value(iter, Columns.WORKSPACE, index); + this._changedPermitted = true; }, _refresh: function() { - if (!this._changedPermitted) - // Ignore this notification, model is being modified outside - return; + if (!this._changedPermitted) + // Ignore this notification, model is being modified outside + return; - this._store.clear(); + this._store.clear(); - let currentItems = this._settings.get_strv(SETTINGS_KEY); - let validItems = [ ]; - for (let i = 0; i < currentItems.length; i++) { - let [id, index] = currentItems[i].split(':'); - let appInfo = Gio.DesktopAppInfo.new(id); - if (!appInfo) - continue; - validItems.push(currentItems[i]); + let currentItems = this._settings.get_strv(SETTINGS_KEY); + let validItems = [ ]; + for (let i = 0; i < currentItems.length; i++) { + let [id, index] = currentItems[i].split(':'); + let appInfo = Gio.DesktopAppInfo.new(id); + if (!appInfo) + continue; + validItems.push(currentItems[i]); - let iter = this._store.append(); - let adj = new Gtk.Adjustment({ lower: 1, - upper: WORKSPACE_MAX, - step_increment: 1, + let iter = this._store.append(); + let adj = new Gtk.Adjustment({ lower: 1, + upper: WORKSPACE_MAX, + step_increment: 1, value: index }); - this._store.set(iter, - [Columns.APPINFO, Columns.ICON, Columns.DISPLAY_NAME, Columns.WORKSPACE, Columns.ADJUSTMENT], - [appInfo, appInfo.get_icon(), appInfo.get_display_name(), parseInt(index), adj]); - } + this._store.set(iter, + [Columns.APPINFO, Columns.ICON, Columns.DISPLAY_NAME, Columns.WORKSPACE, Columns.ADJUSTMENT], + [appInfo, appInfo.get_icon(), appInfo.get_display_name(), parseInt(index), adj]); + } - if (validItems.length != currentItems.length) // some items were filtered out - this._settings.set_strv(SETTINGS_KEY, validItems); + if (validItems.length != currentItems.length) // some items were filtered out + this._settings.set_strv(SETTINGS_KEY, validItems); }, _checkId: function(id) { @@ -226,34 +226,34 @@ const Widget = new GObject.Class({ }, _appendItem: function(id, workspace) { - let currentItems = this._settings.get_strv(SETTINGS_KEY); - currentItems.push(id + ':' + workspace); - this._settings.set_strv(SETTINGS_KEY, currentItems); + let currentItems = this._settings.get_strv(SETTINGS_KEY); + currentItems.push(id + ':' + workspace); + this._settings.set_strv(SETTINGS_KEY, currentItems); }, _removeItem: function(id) { - let currentItems = this._settings.get_strv(SETTINGS_KEY); - let index = currentItems.map(function(el) { - return el.split(':')[0]; - }).indexOf(id); + let currentItems = this._settings.get_strv(SETTINGS_KEY); + let index = currentItems.map(function(el) { + return el.split(':')[0]; + }).indexOf(id); - if (index < 0) - return; - currentItems.splice(index, 1); - this._settings.set_strv(SETTINGS_KEY, currentItems); + if (index < 0) + return; + currentItems.splice(index, 1); + this._settings.set_strv(SETTINGS_KEY, currentItems); }, _changeItem: function(id, workspace) { - let currentItems = this._settings.get_strv(SETTINGS_KEY); - let index = currentItems.map(function(el) { - return el.split(':')[0]; - }).indexOf(id); + let currentItems = this._settings.get_strv(SETTINGS_KEY); + let index = currentItems.map(function(el) { + return el.split(':')[0]; + }).indexOf(id); - if (index < 0) - currentItems.push(id + ':' + workspace); - else - currentItems[index] = id + ':' + workspace; - this._settings.set_strv(SETTINGS_KEY, currentItems); + if (index < 0) + currentItems.push(id + ':' + workspace); + else + currentItems[index] = id + ':' + workspace; + this._settings.set_strv(SETTINGS_KEY, currentItems); } }); diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index f0b1068e..f63868cc 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -23,19 +23,19 @@ const MountMenuItem = new Lang.Class({ Extends: PopupMenu.PopupBaseMenuItem, _init: function(mount) { - this.parent(); + this.parent(); - this.label = new St.Label({ text: mount.get_name() }); - this.actor.add(this.label, { expand: true }); + this.label = new St.Label({ text: mount.get_name() }); + this.actor.add(this.label, { expand: true }); this.actor.label_actor = this.label; - this.mount = mount; + this.mount = mount; - let ejectIcon = new St.Icon({ icon_name: 'media-eject-symbolic', - style_class: 'popup-menu-icon ' }); - let ejectButton = new St.Button({ child: ejectIcon }); - ejectButton.connect('clicked', Lang.bind(this, this._eject)); - this.actor.add(ejectButton); + let ejectIcon = new St.Icon({ icon_name: 'media-eject-symbolic', + style_class: 'popup-menu-icon ' }); + let ejectButton = new St.Button({ child: ejectIcon }); + ejectButton.connect('clicked', Lang.bind(this, this._eject)); + this.actor.add(ejectButton); this._changedId = mount.connect('changed', Lang.bind(this, this._syncVisibility)); this._syncVisibility(); @@ -74,38 +74,38 @@ const MountMenuItem = new Lang.Class({ _eject: function() { let mountOp = new ShellMountOperation.ShellMountOperation(this.mount); - if (this.mount.can_eject()) - this.mount.eject_with_operation(Gio.MountUnmountFlags.NONE, + if (this.mount.can_eject()) + this.mount.eject_with_operation(Gio.MountUnmountFlags.NONE, mountOp.mountOp, - null, // Gio.Cancellable - Lang.bind(this, this._ejectFinish)); - else - this.mount.unmount_with_operation(Gio.MountUnmountFlags.NONE, + null, // Gio.Cancellable + Lang.bind(this, this._ejectFinish)); + else + this.mount.unmount_with_operation(Gio.MountUnmountFlags.NONE, mountOp.mountOp, - null, // Gio.Cancellable - Lang.bind(this, this._unmountFinish)); + null, // Gio.Cancellable + Lang.bind(this, this._unmountFinish)); }, _unmountFinish: function(mount, result) { - try { - mount.unmount_with_operation_finish(result); - } catch(e) { - this._reportFailure(e); - } + try { + mount.unmount_with_operation_finish(result); + } catch(e) { + this._reportFailure(e); + } }, _ejectFinish: function(mount, result) { - try { - mount.eject_with_operation_finish(result); - } catch(e) { - this._reportFailure(e); - } + try { + mount.eject_with_operation_finish(result); + } catch(e) { + this._reportFailure(e); + } }, _reportFailure: function(exception) { - // TRANSLATORS: %s is the filesystem name - let msg = _("Ejecting drive “%s” failed:").format(this.mount.get_name()); - Main.notifyError(msg, exception.message); + // TRANSLATORS: %s is the filesystem name + let msg = _("Ejecting drive “%s” failed:").format(this.mount.get_name()); + Main.notifyError(msg, exception.message); }, activate: function(event) { @@ -113,7 +113,7 @@ const MountMenuItem = new Lang.Class({ Gio.AppInfo.launch_default_for_uri(this.mount.get_root().get_uri(), context); - this.parent(event); + this.parent(event); } }); @@ -132,64 +132,64 @@ const DriveMenu = new Lang.Class({ hbox.add_child(PopupMenu.arrowIcon(St.Side.BOTTOM)); this.actor.add_child(hbox); - this._monitor = Gio.VolumeMonitor.get(); - this._addedId = this._monitor.connect('mount-added', Lang.bind(this, function(monitor, mount) { - this._addMount(mount); - this._updateMenuVisibility(); - })); - this._removedId = this._monitor.connect('mount-removed', Lang.bind(this, function(monitor, mount) { - this._removeMount(mount); - this._updateMenuVisibility(); - })); + this._monitor = Gio.VolumeMonitor.get(); + this._addedId = this._monitor.connect('mount-added', Lang.bind(this, function(monitor, mount) { + this._addMount(mount); + this._updateMenuVisibility(); + })); + this._removedId = this._monitor.connect('mount-removed', Lang.bind(this, function(monitor, mount) { + this._removeMount(mount); + this._updateMenuVisibility(); + })); - this._mounts = [ ]; + this._mounts = [ ]; - this._monitor.get_mounts().forEach(Lang.bind(this, this._addMount)); + this._monitor.get_mounts().forEach(Lang.bind(this, this._addMount)); - this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - this.menu.addAction(_("Open Files"), function(event) { - let appSystem = Shell.AppSystem.get_default(); - let app = appSystem.lookup_app('org.gnome.Nautilus.desktop'); - app.activate_full(-1, event.get_time()); - }); + this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); + this.menu.addAction(_("Open Files"), function(event) { + let appSystem = Shell.AppSystem.get_default(); + let app = appSystem.lookup_app('org.gnome.Nautilus.desktop'); + app.activate_full(-1, event.get_time()); + }); - this._updateMenuVisibility(); + this._updateMenuVisibility(); }, _updateMenuVisibility: function() { - if (this._mounts.filter(function(i) i.actor.visible).length > 0) - this.actor.show(); - else - this.actor.hide(); + if (this._mounts.filter(function(i) i.actor.visible).length > 0) + this.actor.show(); + else + this.actor.hide(); }, _addMount: function(mount) { - let item = new MountMenuItem(mount); - this._mounts.unshift(item); - this.menu.addMenuItem(item, 0); + let item = new MountMenuItem(mount); + this._mounts.unshift(item); + this.menu.addMenuItem(item, 0); }, _removeMount: function(mount) { - for (let i = 0; i < this._mounts.length; i++) { - let item = this._mounts[i]; - if (item.mount == mount) { - item.destroy(); - this._mounts.splice(i, 1); - return; - } - } - log ('Removing a mount that was never added to the menu'); + for (let i = 0; i < this._mounts.length; i++) { + let item = this._mounts[i]; + if (item.mount == mount) { + item.destroy(); + this._mounts.splice(i, 1); + return; + } + } + log ('Removing a mount that was never added to the menu'); }, destroy: function() { if (this._connectedId) { - this._monitor.disconnect(this._connectedId); - this._monitor.disconnect(this._disconnectedId); + this._monitor.disconnect(this._connectedId); + this._monitor.disconnect(this._disconnectedId); this._connectedId = 0; this._disconnectedId = 0; } - this.parent(); + this.parent(); }, }); diff --git a/extensions/example/extension.js b/extensions/example/extension.js index 752b3737..96a6f787 100644 --- a/extensions/example/extension.js +++ b/extensions/example/extension.js @@ -43,7 +43,7 @@ function disable() { log ('Example extension disabled'); if (signalId) { - Main.panel.actor.disconnect(signalId); - signalId = 0; + Main.panel.actor.disconnect(signalId); + signalId = 0; } } diff --git a/extensions/example/prefs.js b/extensions/example/prefs.js index 8491b8e6..c40e8094 100644 --- a/extensions/example/prefs.js +++ b/extensions/example/prefs.js @@ -22,12 +22,12 @@ const ExamplePrefsWidget = new GObject.Class({ Extends: Gtk.Grid, _init: function(params) { - this.parent(params); + this.parent(params); this.margin = 12; this.row_spacing = this.column_spacing = 6; this.set_orientation(Gtk.Orientation.VERTICAL); - this.add(new Gtk.Label({ label: '' + _("Message") + '', + this.add(new Gtk.Label({ label: '' + _("Message") + '', use_markup: true, halign: Gtk.Align.START })); @@ -35,16 +35,16 @@ const ExamplePrefsWidget = new GObject.Class({ margin_bottom: 12 }); this.add(entry); - this._settings = Convenience.getSettings(); - this._settings.bind('hello-text', entry, 'text', Gio.SettingsBindFlags.DEFAULT); + this._settings = Convenience.getSettings(); + this._settings.bind('hello-text', entry, 'text', Gio.SettingsBindFlags.DEFAULT); - // TRANSLATORS: Example is the name of the extension, should not be - // translated - let primaryText = _("Example aims to show how to build well behaved \ + // TRANSLATORS: Example is the name of the extension, should not be + // translated + let primaryText = _("Example aims to show how to build well behaved \ extensions for the Shell and as such it has little functionality on its own.\n\ Nevertheless it’s possible to customize the greeting message."); - this.add(new Gtk.Label({ label: primaryText, + this.add(new Gtk.Label({ label: primaryText, wrap: true, xalign: 0 })); } }); diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index f7c11c65..8be720d6 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -28,12 +28,12 @@ const PlaceMenuItem = new Lang.Class({ Extends: PopupMenu.PopupBaseMenuItem, _init: function(info) { - this.parent(); - this._info = info; + this.parent(); + this._info = info; this._icon = new St.Icon({ gicon: info.icon, icon_size: PLACE_ICON_SIZE }); - this.actor.add_child(this._icon); + this.actor.add_child(this._icon); this._label = new St.Label({ text: info.name, x_expand: true }); this.actor.add_child(this._label); @@ -60,9 +60,9 @@ const PlaceMenuItem = new Lang.Class({ }, activate: function(event) { - this._info.launch(event.get_time()); + this._info.launch(event.get_time()); - this.parent(event); + this.parent(event); }, _propertiesChanged: function(info) { @@ -95,29 +95,29 @@ const PlacesMenu = new Lang.Class({ this.placesManager = new PlaceDisplay.PlacesManager(); - this._sections = { }; + this._sections = { }; - for (let i=0; i < SECTIONS.length; i++) { - let id = SECTIONS[i]; - this._sections[id] = new PopupMenu.PopupMenuSection(); - this.placesManager.connect(id + '-updated', Lang.bind(this, function() { - this._redisplay(id); - })); + for (let i=0; i < SECTIONS.length; i++) { + let id = SECTIONS[i]; + this._sections[id] = new PopupMenu.PopupMenuSection(); + this.placesManager.connect(id + '-updated', Lang.bind(this, function() { + this._redisplay(id); + })); - this._create(id); - this.menu.addMenuItem(this._sections[id]); - this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - } + this._create(id); + this.menu.addMenuItem(this._sections[id]); + this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); + } }, destroy: function() { - this.placesManager.destroy(); + this.placesManager.destroy(); this.parent(); }, _redisplay: function(id) { - this._sections[id].removeAll(); + this._sections[id].removeAll(); this._create(id); }, @@ -127,7 +127,7 @@ const PlacesMenu = new Lang.Class({ for (let i = 0; i < places.length; i++) this._sections[id].addMenuItem(new PlaceMenuItem(places[i])); - this._sections[id].actor.visible = places.length > 0; + this._sections[id].actor.visible = places.length > 0; } }); @@ -142,7 +142,7 @@ function enable() { let pos = 1; if ('apps-menu' in Main.panel.statusArea) - pos = 2; + pos = 2; Main.panel.addToStatusArea('places-menu', _indicator, pos, 'left'); } diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index 37a3a08d..628c5a2d 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -27,104 +27,104 @@ const WorkspaceIndicator = new Lang.Class({ Extends: PanelMenu.Button, _init: function() { - this.parent(0.0, _("Workspace Indicator")); + this.parent(0.0, _("Workspace Indicator")); - this._currentWorkspace = global.screen.get_active_workspace().index(); - this.statusLabel = new St.Label({ y_align: Clutter.ActorAlign.CENTER, + this._currentWorkspace = global.screen.get_active_workspace().index(); + this.statusLabel = new St.Label({ y_align: Clutter.ActorAlign.CENTER, text: this._labelText() }); - this.actor.add_actor(this.statusLabel); + this.actor.add_actor(this.statusLabel); - this.workspacesItems = []; - this._workspaceSection = new PopupMenu.PopupMenuSection(); - this.menu.addMenuItem(this._workspaceSection); + this.workspacesItems = []; + this._workspaceSection = new PopupMenu.PopupMenuSection(); + this.menu.addMenuItem(this._workspaceSection); - this._screenSignals = []; - this._screenSignals.push(global.screen.connect_after('workspace-added', Lang.bind(this,this._createWorkspacesSection))); - this._screenSignals.push(global.screen.connect_after('workspace-removed', Lang.bind(this,this._createWorkspacesSection))); - this._screenSignals.push(global.screen.connect_after('workspace-switched', Lang.bind(this,this._updateIndicator))); + this._screenSignals = []; + this._screenSignals.push(global.screen.connect_after('workspace-added', Lang.bind(this,this._createWorkspacesSection))); + this._screenSignals.push(global.screen.connect_after('workspace-removed', Lang.bind(this,this._createWorkspacesSection))); + this._screenSignals.push(global.screen.connect_after('workspace-switched', Lang.bind(this,this._updateIndicator))); - this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); - this._createWorkspacesSection(); + this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); + this._createWorkspacesSection(); - //styling - this.statusLabel.add_style_class_name('panel-workspace-indicator'); + //styling + this.statusLabel.add_style_class_name('panel-workspace-indicator'); this._settings = new Gio.Settings({ schema_id: WORKSPACE_SCHEMA }); this._settingsChangedId = this._settings.connect('changed::' + WORKSPACE_KEY, Lang.bind(this, this._createWorkspacesSection)); }, destroy: function() { - for (let i = 0; i < this._screenSignals.length; i++) - global.screen.disconnect(this._screenSignals[i]); + for (let i = 0; i < this._screenSignals.length; i++) + global.screen.disconnect(this._screenSignals[i]); if (this._settingsChangedId) { this._settings.disconnect(this._settingsChangedId); this._settingsChangedId = 0; } - this.parent(); + this.parent(); }, _updateIndicator: function() { - this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.NONE); - this._currentWorkspace = global.screen.get_active_workspace().index(); - this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.DOT); + this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.NONE); + this._currentWorkspace = global.screen.get_active_workspace().index(); + this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.DOT); - this.statusLabel.set_text(this._labelText()); + this.statusLabel.set_text(this._labelText()); }, _labelText: function(workspaceIndex) { - if(workspaceIndex == undefined) { - workspaceIndex = this._currentWorkspace; - return (workspaceIndex + 1).toString(); - } - return Meta.prefs_get_workspace_name(workspaceIndex); + if(workspaceIndex == undefined) { + workspaceIndex = this._currentWorkspace; + return (workspaceIndex + 1).toString(); + } + return Meta.prefs_get_workspace_name(workspaceIndex); }, _createWorkspacesSection: function() { - this._workspaceSection.removeAll(); - this.workspacesItems = []; - this._currentWorkspace = global.screen.get_active_workspace().index(); + this._workspaceSection.removeAll(); + this.workspacesItems = []; + this._currentWorkspace = global.screen.get_active_workspace().index(); - let i = 0; - for(; i < global.screen.n_workspaces; i++) { - this.workspacesItems[i] = new PopupMenu.PopupMenuItem(this._labelText(i)); - this._workspaceSection.addMenuItem(this.workspacesItems[i]); - this.workspacesItems[i].workspaceId = i; - this.workspacesItems[i].label_actor = this.statusLabel; - let self = this; - this.workspacesItems[i].connect('activate', Lang.bind(this, function(actor, event) { - this._activate(actor.workspaceId); - })); + let i = 0; + for(; i < global.screen.n_workspaces; i++) { + this.workspacesItems[i] = new PopupMenu.PopupMenuItem(this._labelText(i)); + this._workspaceSection.addMenuItem(this.workspacesItems[i]); + this.workspacesItems[i].workspaceId = i; + this.workspacesItems[i].label_actor = this.statusLabel; + let self = this; + this.workspacesItems[i].connect('activate', Lang.bind(this, function(actor, event) { + this._activate(actor.workspaceId); + })); - if (i == this._currentWorkspace) - this.workspacesItems[i].setOrnament(PopupMenu.Ornament.DOT); - } + if (i == this._currentWorkspace) + this.workspacesItems[i].setOrnament(PopupMenu.Ornament.DOT); + } - this.statusLabel.set_text(this._labelText()); + this.statusLabel.set_text(this._labelText()); }, _activate: function(index) { - if(index >= 0 && index < global.screen.n_workspaces) { - let metaWorkspace = global.screen.get_workspace_by_index(index); - metaWorkspace.activate(global.get_current_time()); - } + if(index >= 0 && index < global.screen.n_workspaces) { + let metaWorkspace = global.screen.get_workspace_by_index(index); + metaWorkspace.activate(global.get_current_time()); + } }, _onScrollEvent: function(actor, event) { - let direction = event.get_scroll_direction(); - let diff = 0; - if (direction == Clutter.ScrollDirection.DOWN) { - diff = 1; - } else if (direction == Clutter.ScrollDirection.UP) { - diff = -1; - } else { - return; - } + let direction = event.get_scroll_direction(); + let diff = 0; + if (direction == Clutter.ScrollDirection.DOWN) { + diff = 1; + } else if (direction == Clutter.ScrollDirection.UP) { + diff = -1; + } else { + return; + } - let newIndex = global.screen.get_active_workspace().index() + diff; - this._activate(newIndex); + let newIndex = global.screen.get_active_workspace().index() + diff; + this._activate(newIndex); }, }); From 968ae427f1d2cd40a232123a627bc82a01125bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 27 Oct 2017 18:33:30 +0200 Subject: [PATCH 30/60] cleanup: Use arrow-notation for anonymous functions Arrow notation is great, but as we only started using it recently, we currently have a wild mix of Lang.bind(), function() and () => {}. To make the style consistent again, change all anonymous functions to arrow notation. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30 --- extensions/alternate-tab/prefs.js | 7 +- extensions/apps-menu/extension.js | 37 ++--- extensions/auto-move-windows/extension.js | 4 +- extensions/auto-move-windows/prefs.js | 31 ++-- extensions/drive-menu/extension.js | 12 +- extensions/example/extension.js | 2 +- extensions/places-menu/extension.js | 6 +- extensions/places-menu/placeDisplay.js | 32 ++-- .../screenshot-window-sizer/extension.js | 6 +- extensions/window-list/extension.js | 151 ++++++++---------- extensions/window-list/prefs.js | 5 +- extensions/windowsNavigator/extension.js | 4 +- extensions/workspace-indicator/extension.js | 4 +- extensions/workspace-indicator/prefs.js | 9 +- 14 files changed, 131 insertions(+), 179 deletions(-) diff --git a/extensions/alternate-tab/prefs.js b/extensions/alternate-tab/prefs.js index b8c42007..64cf4ed9 100644 --- a/extensions/alternate-tab/prefs.js +++ b/extensions/alternate-tab/prefs.js @@ -3,11 +3,10 @@ const Gio = imports.gi.Gio; const Gtk = imports.gi.Gtk; const GObject = imports.gi.GObject; -const Lang = imports.lang; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; -const N_ = function(e) { return e }; +const N_ = e => e; const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); @@ -56,10 +55,10 @@ const AltTabSettingsWidget = new GObject.Class({ let name = Gettext.gettext(MODES[mode]); radio = new Gtk.RadioButton({ group: radio, label: name, valign: Gtk.Align.START }); - radio.connect('toggled', Lang.bind(this, function(widget) { + radio.connect('toggled', widget => { if (widget.active) this._settings.set_string(SETTINGS_APP_ICON_MODE, modeCapture); - })); + }); grid.add(radio); if (mode == currentMode) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index c2ecf5f5..459d5a21 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -68,10 +68,9 @@ const ApplicationMenuItem = new Lang.Class({ let textureCache = St.TextureCache.get_default(); let iconThemeChangedId = textureCache.connect('icon-theme-changed', Lang.bind(this, this._updateIcon)); - this.actor.connect('destroy', Lang.bind(this, - function() { - textureCache.disconnect(iconThemeChangedId); - })); + this.actor.connect('destroy', () => { + textureCache.disconnect(iconThemeChangedId); + }); this._updateIcon(); this.actor._delegate = this; @@ -446,12 +445,12 @@ const ApplicationsButton = new Lang.Class({ this.actor.connect('captured-event', Lang.bind(this, this._onCapturedEvent)); this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); - this._showingId = Main.overview.connect('showing', Lang.bind(this, function() { + this._showingId = Main.overview.connect('showing', () => { this.actor.add_accessible_state (Atk.StateType.CHECKED); - })); - this._hidingId = Main.overview.connect('hiding', Lang.bind(this, function() { + }); + this._hidingId = Main.overview.connect('hiding', () => { this.actor.remove_accessible_state (Atk.StateType.CHECKED); - })); + }); Main.layoutManager.connect('startup-complete', Lang.bind(this, this._setKeybinding)); this._setKeybinding(); @@ -564,9 +563,7 @@ const ApplicationsButton = new Lang.Class({ Main.wm.setCustomKeybindingHandler('panel-main-menu', Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, - Lang.bind(this, function() { - this.menu.toggle(); - })); + () => { this.menu.toggle(); }); }, _redisplay: function() { @@ -642,23 +639,19 @@ const ApplicationsButton = new Lang.Class({ style_class: 'apps-menu vfade' }); this.applicationsScrollBox.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC); let vscroll = this.applicationsScrollBox.get_vscroll_bar(); - vscroll.connect('scroll-start', Lang.bind(this, function() { + vscroll.connect('scroll-start', () => { this.menu.passEvents = true; - })); - vscroll.connect('scroll-stop', Lang.bind(this, function() { + }); + vscroll.connect('scroll-stop', () => { this.menu.passEvents = false; - })); + }); this.categoriesScrollBox = new St.ScrollView({ x_fill: true, y_fill: false, y_align: St.Align.START, style_class: 'vfade' }); this.categoriesScrollBox.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC); vscroll = this.categoriesScrollBox.get_vscroll_bar(); - vscroll.connect('scroll-start', Lang.bind(this, function() { - this.menu.passEvents = true; - })); - vscroll.connect('scroll-stop', Lang.bind(this, function() { - this.menu.passEvents = false; - })); + vscroll.connect('scroll-start', () => { this.menu.passEvents = true; }); + vscroll.connect('scroll-stop', () => { this.menu.passEvents = false; }); this.leftBox.add(this.categoriesScrollBox, { expand: true, x_fill: true, y_fill: true, y_align: St.Align.START }); @@ -767,7 +760,7 @@ const ApplicationsButton = new Lang.Class({ }, destroy: function() { - this.menu.actor.get_children().forEach(function(c) { c.destroy() }); + this.menu.actor.get_children().forEach(c => { c.destroy() }); this.parent(); } }); diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index 05e6321a..4d367d76 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -55,10 +55,10 @@ const WindowMover = new Lang.Class({ if (!app) { if (!noRecurse) { // window is not tracked yet - Mainloop.idle_add(Lang.bind(this, function() { + Mainloop.idle_add(() => { this._findAndMove(display, window, true); return false; - })); + }); } else log ('Cannot find application for window'); return; diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index ebed660f..e562a9de 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -8,7 +8,7 @@ const Lang = imports.lang; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; -const N_ = function(e) { return e }; +const N_ = e => e; const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); @@ -88,10 +88,9 @@ const Widget = new GObject.Class({ toolbar.add(delButton); let selection = this._treeView.get_selection(); - selection.connect('changed', - function() { - delButton.sensitive = selection.count_selected_rows() > 0; - }); + selection.connect('changed', () => { + delButton.sensitive = selection.count_selected_rows() > 0; + }); delButton.sensitive = selection.count_selected_rows() > 0; this._changedPermitted = true; @@ -111,11 +110,9 @@ const Widget = new GObject.Class({ row_spacing: 15, margin: 10 }); dialog._appChooser = new Gtk.AppChooserWidget({ show_all: true }); - dialog._appChooser.connect('application-selected', Lang.bind(this, - function(w, appInfo) { - addButton.sensitive = appInfo && - this._checkId(appInfo.get_id()); - })); + dialog._appChooser.connect('application-selected', (w, appInfo) => { + addButton.sensitive = appInfo && this._checkId(appInfo.get_id()); + }); let appInfo = dialog._appChooser.get_app_info(); addButton.sensitive = appInfo && this._checkId(appInfo.get_id()); @@ -132,7 +129,7 @@ const Widget = new GObject.Class({ grid.attach(dialog._spin, 1, 1, 1, 1); dialog.get_content_area().add(grid); - dialog.connect('response', Lang.bind(this, function(dialog, id) { + dialog.connect('response', (dialog, id) => { if (id != Gtk.ResponseType.OK) { dialog.destroy(); return; @@ -159,7 +156,7 @@ const Widget = new GObject.Class({ [appInfo, appInfo.get_icon(), appInfo.get_display_name(), index, adj]); dialog.destroy(); - })); + }); dialog.show_all(); }, @@ -222,7 +219,7 @@ const Widget = new GObject.Class({ _checkId: function(id) { let items = this._settings.get_strv(SETTINGS_KEY); - return !items.some(function(i) { return i.startsWith(id + ':'); }); + return !items.some(i => i.startsWith(id + ':')); }, _appendItem: function(id, workspace) { @@ -233,9 +230,7 @@ const Widget = new GObject.Class({ _removeItem: function(id) { let currentItems = this._settings.get_strv(SETTINGS_KEY); - let index = currentItems.map(function(el) { - return el.split(':')[0]; - }).indexOf(id); + let index = currentItems.map(el => el.split(':')[0]).indexOf(id); if (index < 0) return; @@ -245,9 +240,7 @@ const Widget = new GObject.Class({ _changeItem: function(id, workspace) { let currentItems = this._settings.get_strv(SETTINGS_KEY); - let index = currentItems.map(function(el) { - return el.split(':')[0]; - }).indexOf(id); + let index = currentItems.map(el => el.split(':')[0]).indexOf(id); if (index < 0) currentItems.push(id + ':' + workspace); diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index f63868cc..249600c5 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -133,21 +133,21 @@ const DriveMenu = new Lang.Class({ this.actor.add_child(hbox); this._monitor = Gio.VolumeMonitor.get(); - this._addedId = this._monitor.connect('mount-added', Lang.bind(this, function(monitor, mount) { + this._addedId = this._monitor.connect('mount-added', (monitor, mount) => { this._addMount(mount); this._updateMenuVisibility(); - })); - this._removedId = this._monitor.connect('mount-removed', Lang.bind(this, function(monitor, mount) { + }); + this._removedId = this._monitor.connect('mount-removed', (monitor, mount) => { this._removeMount(mount); this._updateMenuVisibility(); - })); + }); this._mounts = [ ]; this._monitor.get_mounts().forEach(Lang.bind(this, this._addMount)); this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - this.menu.addAction(_("Open Files"), function(event) { + this.menu.addAction(_("Open Files"), event => { let appSystem = Shell.AppSystem.get_default(); let app = appSystem.lookup_app('org.gnome.Nautilus.desktop'); app.activate_full(-1, event.get_time()); @@ -157,7 +157,7 @@ const DriveMenu = new Lang.Class({ }, _updateMenuVisibility: function() { - if (this._mounts.filter(function(i) i.actor.visible).length > 0) + if (this._mounts.filter(i => i.actor.visible).length > 0) this.actor.show(); else this.actor.hide(); diff --git a/extensions/example/extension.js b/extensions/example/extension.js index 96a6f787..b55a9b84 100644 --- a/extensions/example/extension.js +++ b/extensions/example/extension.js @@ -20,7 +20,7 @@ function _showHello() { let monitor = Main.layoutManager.primaryMonitor; global.stage.add_actor(label); label.set_position(Math.floor (monitor.width / 2 - label.width / 2), Math.floor(monitor.height / 2 - label.height / 2)); - Mainloop.timeout_add(3000, function() { label.destroy(); }); + Mainloop.timeout_add(3000, () => { label.destroy(); }); } // Put your extension initialization code here diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index 8be720d6..d26b9b75 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -14,7 +14,7 @@ const Panel = imports.ui.panel; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; -const N_ = function(x) { return x; } +const N_ = x => x; const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); @@ -100,9 +100,9 @@ const PlacesMenu = new Lang.Class({ for (let i=0; i < SECTIONS.length; i++) { let id = SECTIONS[i]; this._sections[id] = new PopupMenu.PopupMenuSection(); - this.placesManager.connect(id + '-updated', Lang.bind(this, function() { + this.placesManager.connect(id + '-updated', () => { this._redisplay(id); - })); + }); this._create(id); this.menu.addMenuItem(this._sections[id]); diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index bf7372ac..7804335d 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -17,7 +17,7 @@ const Util = imports.misc.util; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; -const N_ = function(x) { return x; } +const N_ = x => x; const BACKGROUND_SCHEMA = 'org.gnome.desktop.background'; @@ -91,7 +91,7 @@ const PlaceInfo = new Lang.Class({ getIcon: function() { this.file.query_info_async('standard::symbolic-icon', 0, 0, null, - Lang.bind(this, function(file, result) { + (file, result) => { try { let info = file.query_info_finish(result); this.icon = info.get_symbolic_icon(); @@ -99,7 +99,7 @@ const PlaceInfo = new Lang.Class({ } catch(e if e instanceof Gio.IOErrorEnum) { return; } - })); + }); // return a generic icon for this kind for now, until we have the // icon from the query info above @@ -139,14 +139,14 @@ const RootInfo = new Lang.Class({ this._proxy = new Hostname1(Gio.DBus.system, 'org.freedesktop.hostname1', '/org/freedesktop/hostname1', - Lang.bind(this, function(obj, error) { + (obj, error) => { if (error) return; this._proxy.connect('g-properties-changed', Lang.bind(this, this._propertiesChanged)); this._propertiesChanged(obj); - })); + }); }, getIcon: function() { @@ -238,13 +238,13 @@ const PlaceVolumeInfo = new Lang.Class({ return; } - this._volume.mount(0, null, null, Lang.bind(this, function(volume, result) { + this._volume.mount(0, null, null, (volume, result) => { volume.mount_finish(result); let mount = volume.get_mount(); this.file = mount.get_root(); this.parent(timestamp); - })); + }); }, getIcon: function() { @@ -290,16 +290,16 @@ var PlacesManager = new Lang.Class({ if (this._bookmarksFile) { this._monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null); - this._monitor.connect('changed', Lang.bind(this, function() { + this._monitor.connect('changed', () => { if (this._bookmarkTimeoutId > 0) return; /* Defensive event compression */ - this._bookmarkTimeoutId = Mainloop.timeout_add(100, Lang.bind(this, function() { + this._bookmarkTimeoutId = Mainloop.timeout_add(100, () => { this._bookmarkTimeoutId = 0; this._reloadBookmarks(); return false; - })); - })); + }); + }); this._reloadBookmarks(); } @@ -333,7 +333,7 @@ var PlacesManager = new Lang.Class({ }, _updateSpecials: function() { - this._places.special.forEach(function(p) { p.destroy(); }); + this._places.special.forEach(p => { p.destroy(); }); this._places.special = []; let homePath = GLib.get_home_dir(); @@ -363,9 +363,7 @@ var PlacesManager = new Lang.Class({ specials.push(info); } - specials.sort(function(a, b) { - return GLib.utf8_collate(a.name, b.name); - }); + specials.sort((a, b) => GLib.utf8_collate(a.name, b.name)); this._places.special = this._places.special.concat(specials); this.emit('special-updated'); @@ -375,9 +373,9 @@ var PlacesManager = new Lang.Class({ let networkMounts = []; let networkVolumes = []; - this._places.devices.forEach(function(p) { p.destroy(); }); + this._places.devices.forEach(p => { p.destroy(); }); this._places.devices = []; - this._places.network.forEach(function(p) { p.destroy(); }); + this._places.network.forEach(p => { p.destroy(); }); this._places.network = []; /* Add standard places */ diff --git a/extensions/screenshot-window-sizer/extension.js b/extensions/screenshot-window-sizer/extension.js index e9f19da6..681c30ff 100644 --- a/extensions/screenshot-window-sizer/extension.js +++ b/extensions/screenshot-window-sizer/extension.js @@ -84,11 +84,7 @@ function cycleScreenshotSizes(display, screen, window, binding) { // Double both axes if on a hidpi display let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; - let scaledSizes = SIZES.map(function(size) { - return size.map(function(wh) { - return wh * scaleFactor; - }); - }); + let scaledSizes = SIZES.map(size => size.map(wh => wh * scaleFactor)); // Find the nearest 16:9 size for the current window size let nearestIndex; diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index b0051550..9f34b312 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -57,8 +57,8 @@ function _onMenuStateChanged(menu, isOpen) { } function _getAppStableSequence(app) { - let windows = app.get_windows().filter(function(w) { return !w.skip_taskbar; }); - return windows.reduce(function(prev, cur) { + let windows = app.get_windows().filter(w => !w.skip_taskbar); + return windows.reduce((prev, cur) => { return Math.min(prev, cur.get_stable_sequence()); }, Infinity); } @@ -74,12 +74,12 @@ const WindowContextMenu = new Lang.Class({ this._metaWindow = metaWindow; this._minimizeItem = new PopupMenu.PopupMenuItem(''); - this._minimizeItem.connect('activate', Lang.bind(this, function() { + this._minimizeItem.connect('activate', () => { if (this._metaWindow.minimized) this._metaWindow.unminimize(); else this._metaWindow.minimize(); - })); + }); this.addMenuItem(this._minimizeItem); this._notifyMinimizedId = @@ -88,7 +88,7 @@ const WindowContextMenu = new Lang.Class({ this._updateMinimizeItem(); this._maximizeItem = new PopupMenu.PopupMenuItem(''); - this._maximizeItem.connect('activate', Lang.bind(this, function() { + this._maximizeItem.connect('activate', () => { if (this._metaWindow.maximized_vertically && this._metaWindow.maximized_horizontally) this._metaWindow.unmaximize(Meta.MaximizeFlags.HORIZONTAL | @@ -96,7 +96,7 @@ const WindowContextMenu = new Lang.Class({ else this._metaWindow.maximize(Meta.MaximizeFlags.HORIZONTAL | Meta.MaximizeFlags.VERTICAL); - })); + }); this.addMenuItem(this._maximizeItem); this._notifyMaximizedHId = @@ -108,9 +108,9 @@ const WindowContextMenu = new Lang.Class({ this._updateMaximizeItem(); this._closeItem = new PopupMenu.PopupMenuItem(_("Close")); - this._closeItem.connect('activate', Lang.bind(this, function() { + this._closeItem.connect('activate', () => { this._metaWindow.delete(global.get_current_time()); - })); + }); this.addMenuItem(this._closeItem); this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); @@ -418,60 +418,52 @@ const AppContextMenu = new Lang.Class({ this._appButton = appButton; this._minimizeItem = new PopupMenu.PopupMenuItem(_("Minimize all")); - this._minimizeItem.connect('activate', Lang.bind(this, function() { - this._appButton.getWindowList().forEach(function(w) { - w.minimize(); - }); - })); + this._minimizeItem.connect('activate', () => { + this._appButton.getWindowList().forEach(w => { w.minimize(); }); + }); this.addMenuItem(this._minimizeItem); this._unminimizeItem = new PopupMenu.PopupMenuItem(_("Unminimize all")); - this._unminimizeItem.connect('activate', Lang.bind(this, function() { - this._appButton.getWindowList().forEach(function(w) { - w.unminimize(); - }); - })); + this._unminimizeItem.connect('activate', () => { + this._appButton.getWindowList().forEach(w => { w.unminimize(); }); + }); this.addMenuItem(this._unminimizeItem); this._maximizeItem = new PopupMenu.PopupMenuItem(_("Maximize all")); - this._maximizeItem.connect('activate', Lang.bind(this, function() { - this._appButton.getWindowList().forEach(function(w) { + this._maximizeItem.connect('activate', () => { + this._appButton.getWindowList().forEach(w => { w.maximize(Meta.MaximizeFlags.HORIZONTAL | Meta.MaximizeFlags.VERTICAL); }); - })); + }); this.addMenuItem(this._maximizeItem); this._unmaximizeItem = new PopupMenu.PopupMenuItem(_("Unmaximize all")); - this._unmaximizeItem.connect('activate', Lang.bind(this, function() { - this._appButton.getWindowList().forEach(function(w) { + this._unmaximizeItem.connect('activate', () => { + this._appButton.getWindowList().forEach(w => { w.unmaximize(Meta.MaximizeFlags.HORIZONTAL | Meta.MaximizeFlags.VERTICAL); }); - })); + }); this.addMenuItem(this._unmaximizeItem); let item = new PopupMenu.PopupMenuItem(_("Close all")); - item.connect('activate', Lang.bind(this, function() { - this._appButton.getWindowList().forEach(function(w) { + item.connect('activate', () => { + this._appButton.getWindowList().forEach(w => { w.delete(global.get_current_time()); }); - })); + }); this.addMenuItem(item); }, open: function(animate) { let windows = this._appButton.getWindowList(); - this._minimizeItem.actor.visible = windows.some(function(w) { - return !w.minimized; - }); - this._unminimizeItem.actor.visible = windows.some(function(w) { - return w.minimized; - }); - this._maximizeItem.actor.visible = windows.some(function(w) { + this._minimizeItem.actor.visible = windows.some(w => !w.minimized); + this._unminimizeItem.actor.visible = windows.some(w => w.minimized); + this._maximizeItem.actor.visible = windows.some(w => { return !(w.maximized_horizontally && w.maximized_vertically); }); - this._unmaximizeItem.actor.visible = windows.some(function(w) { + this._unmaximizeItem.actor.visible = windows.some(w => { return w.maximized_horizontally && w.maximized_vertically; }); @@ -525,10 +517,9 @@ const AppButton = new Lang.Class({ this._textureCache = St.TextureCache.get_default(); this._iconThemeChangedId = - this._textureCache.connect('icon-theme-changed', Lang.bind(this, - function() { - this._icon.child = app.create_icon_texture(ICON_TEXTURE_SIZE); - })); + this._textureCache.connect('icon-theme-changed', () => { + this._icon.child = app.create_icon_texture(ICON_TEXTURE_SIZE); + }); this._windowsChangedId = this.app.connect('windows-changed', @@ -568,15 +559,11 @@ const AppButton = new Lang.Class({ let rect = this._getIconGeometry(); let windows = this.app.get_windows(); - windows.forEach(function(w) { - w.set_icon_geometry(rect); - }); + windows.forEach(w => { w.set_icon_geometry(rect); }); }, getWindowList: function() { - return this.app.get_windows().filter(Lang.bind(this, function(win) { - return this._isWindowVisible(win); - })); + return this.app.get_windows().filter(win => this._isWindowVisible(win)); }, _windowsChanged: function() { @@ -739,9 +726,9 @@ const WorkspaceIndicator = new Lang.Class({ let item = new PopupMenu.PopupMenuItem(name); item.workspaceId = i; - item.connect('activate', Lang.bind(this, function(item, event) { + item.connect('activate', (item, event) => { this._activate(item.workspaceId); - })); + }); if (i == this._currentWorkspace) item.setOrnament(PopupMenu.Ornament.DOT); @@ -807,12 +794,11 @@ const WindowList = new Lang.Class({ y_expand: true }); box.add(this._windowList, { expand: true }); - this._windowList.connect('style-changed', Lang.bind(this, - function() { - let node = this._windowList.get_theme_node(); - let spacing = node.get_length('spacing'); - this._windowList.layout_manager.spacing = spacing; - })); + this._windowList.connect('style-changed', () => { + let node = this._windowList.get_theme_node(); + let spacing = node.get_length('spacing'); + this._windowList.layout_manager.spacing = spacing; + }); this._windowList.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); let indicatorsBox = new St.BoxLayout({ x_align: Clutter.ActorAlign.END }); @@ -851,7 +837,7 @@ const WindowList = new Lang.Class({ this._keyboardVisiblechangedId = Main.layoutManager.connect('keyboard-visible-changed', - Lang.bind(this, function(o, state) { + (o, state) => { Main.layoutManager.keyboardBox.visible = state; let keyboardBox = Main.layoutManager.keyboardBox; keyboardBox.visible = state; @@ -861,7 +847,7 @@ const WindowList = new Lang.Class({ Main.uiGroup.set_child_above_sibling(this.actor, Main.layoutManager.panelBox); this._updateKeyboardAnchor(); - })); + }); this._workspaceSignals = new Map(); this._nWorkspacesChangedId = @@ -874,21 +860,21 @@ const WindowList = new Lang.Class({ Lang.bind(this, this._checkGrouping)); this._overviewShowingId = - Main.overview.connect('showing', Lang.bind(this, function() { + Main.overview.connect('showing', () => { this.actor.hide(); this._updateKeyboardAnchor(); - })); + }); this._overviewHidingId = - Main.overview.connect('hiding', Lang.bind(this, function() { + Main.overview.connect('hiding', () => { this.actor.visible = !Main.layoutManager.primaryMonitor.inFullscreen; this._updateKeyboardAnchor(); - })); + }); this._fullscreenChangedId = - global.screen.connect('in-fullscreen-changed', Lang.bind(this, function() { + global.screen.connect('in-fullscreen-changed', () => { this._updateKeyboardAnchor(); - })); + }); this._dragBeginId = Main.xdndHandler.connect('drag-begin', @@ -934,9 +920,7 @@ const WindowList = new Lang.Class({ else return; - let children = this._windowList.get_children().map(function(actor) { - return actor._delegate; - }); + let children = this._windowList.get_children().map(a => a._delegate); let active = 0; for (let i = 0; i < children.length; i++) { if (children[i].active) { @@ -973,11 +957,8 @@ const WindowList = new Lang.Class({ let workspace = global.screen.get_active_workspace(); let windows = global.display.get_tab_list(Meta.TabList.NORMAL, workspace); - if (this._perMonitor) { - windows = windows.filter(Lang.bind(this, function(window) { - return window.get_monitor() == this._monitor.index; - })); - } + if (this._perMonitor) + windows = windows.filter(w => w.get_monitor() == this._monitor.index); let nWindows = windows.length; if (nWindows == 0) return this._windowList.get_preferred_width(-1)[1]; @@ -1019,19 +1000,17 @@ const WindowList = new Lang.Class({ this._windowList.destroy_all_children(); if (!this._grouped) { - let windows = global.get_window_actors().sort( - function(w1, w2) { - return w1.metaWindow.get_stable_sequence() - - w2.metaWindow.get_stable_sequence(); - }); + let windows = global.get_window_actors().sort((w1, w2) => { + return w1.metaWindow.get_stable_sequence() - + w2.metaWindow.get_stable_sequence(); + }); for (let i = 0; i < windows.length; i++) this._onWindowAdded(null, windows[i].metaWindow); } else { - let apps = this._appSystem.get_running().sort( - function(a1, a2) { - return _getAppStableSequence(a1) - - _getAppStableSequence(a2); - }); + let apps = this._appSystem.get_running().sort((a1, a2) => { + return _getAppStableSequence(a1) - + _getAppStableSequence(a2); + }); for (let i = 0; i < apps.length; i++) this._addApp(apps[i]); } @@ -1263,17 +1242,15 @@ const Extension = new Lang.Class({ }, _buildWindowLists: function() { - this._windowLists.forEach(function(windowList) { - windowList.actor.destroy(); - }); + this._windowLists.forEach(list => { list.actor.destroy(); }); this._windowLists = []; let showOnAllMonitors = this._settings.get_boolean('show-on-all-monitors'); - Main.layoutManager.monitors.forEach(Lang.bind(this, function(monitor) { + Main.layoutManager.monitors.forEach(monitor => { if (showOnAllMonitors || monitor == Main.layoutManager.primaryMonitor) this._windowLists.push(new WindowList(showOnAllMonitors, monitor)); - })); + }); }, disable: function() { @@ -1286,7 +1263,7 @@ const Extension = new Lang.Class({ Main.layoutManager.disconnect(this._monitorsChangedId); this._monitorsChangedId = 0; - this._windowLists.forEach(function(windowList) { + this._windowLists.forEach(windowList => { windowList.actor.hide(); windowList.actor.destroy(); }); @@ -1294,9 +1271,7 @@ const Extension = new Lang.Class({ }, someWindowListContains: function(actor) { - return this._windowLists.some(function(windowList) { - return windowList.actor.contains(actor); - }); + return this._windowLists.some(list => list.actor.contains(actor)); } }); diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js index dc200656..e7026ad9 100644 --- a/extensions/window-list/prefs.js +++ b/extensions/window-list/prefs.js @@ -3,7 +3,6 @@ const Gio = imports.gi.Gio; const GObject = imports.gi.GObject; const Gtk = imports.gi.Gtk; -const Lang = imports.lang; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; @@ -66,10 +65,10 @@ const WindowListPrefsWidget = new GObject.Class({ group: radio }); grid.add(radio); - radio.connect('toggled', Lang.bind(this, function(button) { + radio.connect('toggled', button => { if (button.active) this._settings.set_string('grouping-mode', mode); - })); + }); } let check = new Gtk.CheckButton({ label: _("Show on all monitors"), diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js index f674effd..a2a02575 100644 --- a/extensions/windowsNavigator/extension.js +++ b/extensions/windowsNavigator/extension.js @@ -233,9 +233,9 @@ function enable() { visible: false })); this.actor.add_actor(this._tip); - let signalId = this.actor.connect('notify::scale-x', Lang.bind(this, function() { + let signalId = this.actor.connect('notify::scale-x', () => { this._tip.set_scale(1 / this.actor.scale_x, 1 / this.actor.scale_x); - })); + }); connectedSignals.push({ obj: this.actor, id: signalId }); } else this._tip = null; diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index 628c5a2d..810ffb6c 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -94,9 +94,9 @@ const WorkspaceIndicator = new Lang.Class({ this.workspacesItems[i].workspaceId = i; this.workspacesItems[i].label_actor = this.statusLabel; let self = this; - this.workspacesItems[i].connect('activate', Lang.bind(this, function(actor, event) { + this.workspacesItems[i].connect('activate', (actor, event) => { this._activate(actor.workspaceId); - })); + }); if (i == this._currentWorkspace) this.workspacesItems[i].setOrnament(PopupMenu.Ornament.DOT); diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index e5dbebe3..5913ab39 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -8,7 +8,7 @@ const Lang = imports.lang; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; -const N_ = function(e) { return e }; +const N_ = e => e; const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); @@ -175,10 +175,9 @@ const WorkspaceSettingsWidget = new GObject.Class({ toolbar.add(delButton); let selection = this._treeView.get_selection(); - selection.connect('changed', - function() { - delButton.sensitive = selection.count_selected_rows() > 0; - }); + selection.connect('changed', () => { + delButton.sensitive = selection.count_selected_rows() > 0; + }); delButton.sensitive = selection.count_selected_rows() > 0; this.add(toolbar); From 30e7ff5a8fa898c38869bd30f0ccef2b05ac7aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 27 Oct 2017 17:26:36 +0200 Subject: [PATCH 31/60] cleanup: Use method syntax Modern javascript has a short-hand for function properties, embrace it for better readability and to prepare for porting to ES6 classes. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30 --- extensions/alternate-tab/prefs.js | 2 +- extensions/apps-menu/extension.js | 94 +++++----- extensions/auto-move-windows/extension.js | 8 +- extensions/auto-move-windows/prefs.js | 18 +- extensions/drive-menu/extension.js | 28 +-- extensions/example/prefs.js | 2 +- .../native-window-placement/extension.js | 20 +-- extensions/places-menu/extension.js | 16 +- extensions/places-menu/placeDisplay.js | 62 +++---- extensions/user-theme/extension.js | 8 +- extensions/window-list/extension.js | 162 +++++++++--------- extensions/window-list/prefs.js | 2 +- extensions/workspace-indicator/extension.js | 14 +- extensions/workspace-indicator/prefs.js | 18 +- 14 files changed, 227 insertions(+), 227 deletions(-) diff --git a/extensions/alternate-tab/prefs.js b/extensions/alternate-tab/prefs.js index 64cf4ed9..dda78ee7 100644 --- a/extensions/alternate-tab/prefs.js +++ b/extensions/alternate-tab/prefs.js @@ -26,7 +26,7 @@ const AltTabSettingsWidget = new GObject.Class({ GTypeName: 'AltTabSettingsWidget', Extends: Gtk.Grid, - _init: function(params) { + _init(params) { this.parent(params); this.margin = 24; this.row_spacing = 6; diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 459d5a21..ebd90dc3 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -35,13 +35,13 @@ const ActivitiesMenuItem = new Lang.Class({ Name: 'ActivitiesMenuItem', Extends: PopupMenu.PopupBaseMenuItem, - _init: function(button) { + _init(button) { this.parent(); this._button = button; this.actor.add_child(new St.Label({ text: _("Activities Overview") })); }, - activate: function(event) { + activate(event) { this._button.menu.toggle(); Main.overview.toggle(); this.parent(event); @@ -52,7 +52,7 @@ const ApplicationMenuItem = new Lang.Class({ Name: 'ApplicationMenuItem', Extends: PopupMenu.PopupBaseMenuItem, - _init: function(button, app) { + _init(button, app) { this.parent(); this._app = app; this._button = button; @@ -91,32 +91,32 @@ const ApplicationMenuItem = new Lang.Class({ }); }, - activate: function(event) { + activate(event) { this._app.open_new_window(-1); this._button.selectCategory(null, null); this._button.menu.toggle(); this.parent(event); }, - setActive: function(active, params) { + setActive(active, params) { if (active) this._button.scrollToButton(this); this.parent(active, params); }, - setDragEnabled: function(enable) { + setDragEnabled(enable) { this._dragEnabled = enable; }, - getDragActor: function() { + getDragActor() { return this._app.create_icon_texture(APPLICATION_ICON_SIZE); }, - getDragActorSource: function() { + getDragActorSource() { return this._iconBin; }, - _updateIcon: function() { + _updateIcon() { this._iconBin.set_child(this.getDragActor()); } }); @@ -125,7 +125,7 @@ const CategoryMenuItem = new Lang.Class({ Name: 'CategoryMenuItem', Extends: PopupMenu.PopupBaseMenuItem, - _init: function(button, category) { + _init(button, category) { this.parent(); this._category = category; this._button = button; @@ -143,13 +143,13 @@ const CategoryMenuItem = new Lang.Class({ this.actor.connect('motion-event', Lang.bind(this, this._onMotionEvent)); }, - activate: function(event) { + activate(event) { this._button.selectCategory(this._category, this); this._button.scrollToCatButton(this); this.parent(event); }, - _isNavigatingSubmenu: function([x, y]) { + _isNavigatingSubmenu([x, y]) { let [posX, posY] = this.actor.get_transformed_position(); if (this._oldX == -1) { @@ -206,7 +206,7 @@ const CategoryMenuItem = new Lang.Class({ return false; }, - _onMotionEvent: function(actor, event) { + _onMotionEvent(actor, event) { if (!Clutter.get_pointer_grab()) { this._oldX = -1; this._oldY = -1; @@ -229,7 +229,7 @@ const CategoryMenuItem = new Lang.Class({ return false; }, - setActive: function(active, params) { + setActive(active, params) { if (active) { this._button.selectCategory(this._category, this); this._button.scrollToCatButton(this); @@ -242,23 +242,23 @@ const ApplicationsMenu = new Lang.Class({ Name: 'ApplicationsMenu', Extends: PopupMenu.PopupMenu, - _init: function(sourceActor, arrowAlignment, arrowSide, button) { + _init(sourceActor, arrowAlignment, arrowSide, button) { this.parent(sourceActor, arrowAlignment, arrowSide); this._button = button; }, - isEmpty: function() { + isEmpty() { return false; }, - open: function(animate) { + open(animate) { this._button.hotCorner.setBarrierSize(0); if (this._button.hotCorner.actor) // fallback corner this._button.hotCorner.actor.hide(); this.parent(animate); }, - close: function(animate) { + close(animate) { let size = Main.layoutManager.panelBox.height; this._button.hotCorner.setBarrierSize(size); if (this._button.hotCorner.actor) // fallback corner @@ -266,7 +266,7 @@ const ApplicationsMenu = new Lang.Class({ this.parent(animate); }, - toggle: function() { + toggle() { if (this.isOpen) { this._button.selectCategory(null, null); } else { @@ -280,7 +280,7 @@ const ApplicationsMenu = new Lang.Class({ const DesktopTarget = new Lang.Class({ Name: 'DesktopTarget', - _init: function() { + _init() { this._desktop = null; this._desktopDestroyedId = 0; @@ -297,7 +297,7 @@ const DesktopTarget = new Lang.Class({ return this._desktop != null; }, - _onWindowAdded: function(group, actor) { + _onWindowAdded(group, actor) { if (!(actor instanceof Meta.WindowActor)) return; @@ -305,7 +305,7 @@ const DesktopTarget = new Lang.Class({ this._setDesktop(actor); }, - _setDesktop: function(desktop) { + _setDesktop(desktop) { if (this._desktop) { this._desktop.disconnect(this._desktopDestroyedId); this._desktopDestroyedId = 0; @@ -324,13 +324,13 @@ const DesktopTarget = new Lang.Class({ } }, - _getSourceAppInfo: function(source) { + _getSourceAppInfo(source) { if (!(source instanceof ApplicationMenuItem)) return null; return source._app.app_info; }, - _touchFile: function(file) { + _touchFile(file) { let queryFlags = Gio.FileQueryInfoFlags.NONE; let ioPriority = GLib.PRIORITY_DEFAULT; @@ -347,7 +347,7 @@ const DesktopTarget = new Lang.Class({ }); }, - _markTrusted: function(file) { + _markTrusted(file) { let modeAttr = Gio.FILE_ATTRIBUTE_UNIX_MODE; let trustedAttr = 'metadata::trusted'; let queryFlags = Gio.FileQueryInfoFlags.NONE; @@ -374,7 +374,7 @@ const DesktopTarget = new Lang.Class({ }); }, - destroy: function() { + destroy() { if (this._windowAddedId) global.window_group.disconnect(this._windowAddedId); this._windowAddedId = 0; @@ -382,7 +382,7 @@ const DesktopTarget = new Lang.Class({ this._setDesktop(null); }, - handleDragOver: function(source, actor, x, y, time) { + handleDragOver(source, actor, x, y, time) { let appInfo = this._getSourceAppInfo(source); if (!appInfo) return DND.DragMotionResult.CONTINUE; @@ -390,7 +390,7 @@ const DesktopTarget = new Lang.Class({ return DND.DragMotionResult.COPY_DROP; }, - acceptDrop: function(source, actor, x, y, time) { + acceptDrop(source, actor, x, y, time) { let appInfo = this._getSourceAppInfo(source); if (!appInfo) return false; @@ -419,7 +419,7 @@ const ApplicationsButton = new Lang.Class({ Name: 'ApplicationsButton', Extends: PanelMenu.Button, - _init: function() { + _init() { this.parent(1.0, null, false); this.setMenu(new ApplicationsMenu(this.actor, 1.0, St.Side.TOP, this)); @@ -477,7 +477,7 @@ const ApplicationsButton = new Lang.Class({ Lang.bind(this, this._onTreeChanged)); }, - _onTreeChanged: function() { + _onTreeChanged() { if (this.menu.isOpen) { this._redisplay(); this.mainBox.show(); @@ -490,14 +490,14 @@ const ApplicationsButton = new Lang.Class({ return Main.layoutManager.hotCorners[Main.layoutManager.primaryIndex]; }, - _createVertSeparator: function() { + _createVertSeparator() { let separator = new St.DrawingArea({ style_class: 'calendar-vertical-separator', pseudo_class: 'highlighted' }); separator.connect('repaint', Lang.bind(this, this._onVertSepRepaint)); return separator; }, - _onDestroy: function() { + _onDestroy() { Main.overview.disconnect(this._showingId); Main.overview.disconnect(this._hidingId); appSys.disconnect(this._installedChangedId); @@ -514,7 +514,7 @@ const ApplicationsButton = new Lang.Class({ this._desktopTarget.destroy(); }, - _onCapturedEvent: function(actor, event) { + _onCapturedEvent(actor, event) { if (event.type() == Clutter.EventType.BUTTON_PRESS) { if (!Main.overview.shouldToggleByCornerOrButton()) return true; @@ -522,7 +522,7 @@ const ApplicationsButton = new Lang.Class({ return false; }, - _onMenuKeyPress: function(actor, event) { + _onMenuKeyPress(actor, event) { let symbol = event.get_key_symbol(); if (symbol == Clutter.KEY_Left || symbol == Clutter.KEY_Right) { let direction = symbol == Clutter.KEY_Left ? Gtk.DirectionType.LEFT @@ -533,7 +533,7 @@ const ApplicationsButton = new Lang.Class({ return this.parent(actor, event); }, - _onVertSepRepaint: function(area) { + _onVertSepRepaint(area) { let cr = area.get_context(); let themeNode = area.get_theme_node(); let [width, height] = area.get_surface_size(); @@ -548,7 +548,7 @@ const ApplicationsButton = new Lang.Class({ cr.stroke(); }, - _onOpenStateChanged: function(menu, open) { + _onOpenStateChanged(menu, open) { if (open) { if (this.reloadFlag) { this._redisplay(); @@ -559,20 +559,20 @@ const ApplicationsButton = new Lang.Class({ this.parent(menu, open); }, - _setKeybinding: function() { + _setKeybinding() { Main.wm.setCustomKeybindingHandler('panel-main-menu', Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, () => { this.menu.toggle(); }); }, - _redisplay: function() { + _redisplay() { this.applicationsBox.destroy_all_children(); this.categoriesBox.destroy_all_children(); this._display(); }, - _loadCategory: function(categoryId, dir) { + _loadCategory(categoryId, dir) { let iter = dir.iter(); let nextType; while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) { @@ -599,7 +599,7 @@ const ApplicationsButton = new Lang.Class({ } }, - scrollToButton: function(button) { + scrollToButton(button) { let appsScrollBoxAdj = this.applicationsScrollBox.get_vscroll_bar().get_adjustment(); let appsScrollBoxAlloc = this.applicationsScrollBox.get_allocation_box(); let currentScrollValue = appsScrollBoxAdj.get_value(); @@ -614,7 +614,7 @@ const ApplicationsButton = new Lang.Class({ appsScrollBoxAdj.set_value(newScrollValue); }, - scrollToCatButton: function(button) { + scrollToCatButton(button) { let catsScrollBoxAdj = this.categoriesScrollBox.get_vscroll_bar().get_adjustment(); let catsScrollBoxAlloc = this.categoriesScrollBox.get_allocation_box(); let currentScrollValue = catsScrollBoxAdj.get_value(); @@ -629,7 +629,7 @@ const ApplicationsButton = new Lang.Class({ catsScrollBoxAdj.set_value(newScrollValue); }, - _createLayout: function() { + _createLayout() { let section = new PopupMenu.PopupMenuSection(); this.menu.addMenuItem(section); this.mainBox = new St.BoxLayout({ vertical: false }); @@ -672,7 +672,7 @@ const ApplicationsButton = new Lang.Class({ section.actor.add_actor(this.mainBox); }, - _display: function() { + _display() { this._applicationsButtons.clear(); this.mainBox.style=('width: 35em;'); this.mainBox.hide(); @@ -707,7 +707,7 @@ const ApplicationsButton = new Lang.Class({ this.mainBox.style+=('height: ' + height); }, - selectCategory: function(dir, categoryMenuItem) { + selectCategory(dir, categoryMenuItem) { this.applicationsBox.get_children().forEach(c => { if (c._delegate instanceof PopupMenu.PopupSeparatorMenuItem) c._delegate.destroy(); @@ -721,7 +721,7 @@ const ApplicationsButton = new Lang.Class({ this._displayButtons(this._listApplications(null)); }, - _displayButtons: function(apps) { + _displayButtons(apps) { if (apps) { for (let i = 0; i < apps.length; i++) { let app = apps[i]; @@ -741,7 +741,7 @@ const ApplicationsButton = new Lang.Class({ } }, - _listApplications: function(category_menu_id) { + _listApplications(category_menu_id) { let applist; if (category_menu_id) { @@ -759,7 +759,7 @@ const ApplicationsButton = new Lang.Class({ return applist; }, - destroy: function() { + destroy() { this.menu.actor.get_children().forEach(c => { c.destroy() }); this.parent(); } diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index 4d367d76..19be3520 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -22,7 +22,7 @@ let settings; const WindowMover = new Lang.Class({ Name: 'AutoMoveWindows.WindowMover', - _init: function() { + _init() { this._settings = settings; this._windowTracker = Shell.WindowTracker.get_default(); @@ -31,21 +31,21 @@ const WindowMover = new Lang.Class({ this._windowCreatedId = display.connect_after('window-created', Lang.bind(this, this._findAndMove)); }, - destroy: function() { + destroy() { if (this._windowCreatedId) { global.screen.get_display().disconnect(this._windowCreatedId); this._windowCreatedId = 0; } }, - _ensureAtLeastWorkspaces: function(num, window) { + _ensureAtLeastWorkspaces(num, window) { for (let j = global.screen.n_workspaces; j <= num; j++) { window.change_workspace_by_index(j-1, false); global.screen.append_new_workspace(false, 0); } }, - _findAndMove: function(display, window, noRecurse) { + _findAndMove(display, window, noRecurse) { if (window.skip_taskbar) return; diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index e562a9de..52e25fd9 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -31,7 +31,7 @@ const Widget = new GObject.Class({ GTypeName: 'AutoMoveWindowsPrefsWidget', Extends: Gtk.Grid, - _init: function(params) { + _init(params) { this.parent(params); this.set_orientation(Gtk.Orientation.VERTICAL); @@ -97,7 +97,7 @@ const Widget = new GObject.Class({ this._refresh(); }, - _createNew: function() { + _createNew() { let dialog = new Gtk.Dialog({ title: _("Create new matching rule"), transient_for: this.get_toplevel(), use_header_bar: true, @@ -160,7 +160,7 @@ const Widget = new GObject.Class({ dialog.show_all(); }, - _deleteSelected: function() { + _deleteSelected() { let [any, model, iter] = this._treeView.get_selection().get_selected(); if (any) { @@ -173,7 +173,7 @@ const Widget = new GObject.Class({ } }, - _workspaceEdited: function(renderer, pathString, text) { + _workspaceEdited(renderer, pathString, text) { let index = parseInt(text); if (isNaN(index) || index < 0) index = 1; @@ -187,7 +187,7 @@ const Widget = new GObject.Class({ this._changedPermitted = true; }, - _refresh: function() { + _refresh() { if (!this._changedPermitted) // Ignore this notification, model is being modified outside return; @@ -217,18 +217,18 @@ const Widget = new GObject.Class({ this._settings.set_strv(SETTINGS_KEY, validItems); }, - _checkId: function(id) { + _checkId(id) { let items = this._settings.get_strv(SETTINGS_KEY); return !items.some(i => i.startsWith(id + ':')); }, - _appendItem: function(id, workspace) { + _appendItem(id, workspace) { let currentItems = this._settings.get_strv(SETTINGS_KEY); currentItems.push(id + ':' + workspace); this._settings.set_strv(SETTINGS_KEY, currentItems); }, - _removeItem: function(id) { + _removeItem(id) { let currentItems = this._settings.get_strv(SETTINGS_KEY); let index = currentItems.map(el => el.split(':')[0]).indexOf(id); @@ -238,7 +238,7 @@ const Widget = new GObject.Class({ this._settings.set_strv(SETTINGS_KEY, currentItems); }, - _changeItem: function(id, workspace) { + _changeItem(id, workspace) { let currentItems = this._settings.get_strv(SETTINGS_KEY); let index = currentItems.map(el => el.split(':')[0]).indexOf(id); diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index 249600c5..12af2362 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -22,7 +22,7 @@ const MountMenuItem = new Lang.Class({ Name: 'DriveMenu.MountMenuItem', Extends: PopupMenu.PopupBaseMenuItem, - _init: function(mount) { + _init(mount) { this.parent(); this.label = new St.Label({ text: mount.get_name() }); @@ -41,7 +41,7 @@ const MountMenuItem = new Lang.Class({ this._syncVisibility(); }, - destroy: function() { + destroy() { if (this._changedId) { this.mount.disconnect(this._changedId); this._changedId = 0; @@ -50,7 +50,7 @@ const MountMenuItem = new Lang.Class({ this.parent(); }, - _isInteresting: function() { + _isInteresting() { if (!this.mount.can_eject() && !this.mount.can_unmount()) return false; if (this.mount.is_shadowed()) @@ -67,11 +67,11 @@ const MountMenuItem = new Lang.Class({ return volume.get_identifier('class') != 'network'; }, - _syncVisibility: function() { + _syncVisibility() { this.actor.visible = this._isInteresting(); }, - _eject: function() { + _eject() { let mountOp = new ShellMountOperation.ShellMountOperation(this.mount); if (this.mount.can_eject()) @@ -86,7 +86,7 @@ const MountMenuItem = new Lang.Class({ Lang.bind(this, this._unmountFinish)); }, - _unmountFinish: function(mount, result) { + _unmountFinish(mount, result) { try { mount.unmount_with_operation_finish(result); } catch(e) { @@ -94,7 +94,7 @@ const MountMenuItem = new Lang.Class({ } }, - _ejectFinish: function(mount, result) { + _ejectFinish(mount, result) { try { mount.eject_with_operation_finish(result); } catch(e) { @@ -102,13 +102,13 @@ const MountMenuItem = new Lang.Class({ } }, - _reportFailure: function(exception) { + _reportFailure(exception) { // TRANSLATORS: %s is the filesystem name let msg = _("Ejecting drive “%s” failed:").format(this.mount.get_name()); Main.notifyError(msg, exception.message); }, - activate: function(event) { + activate(event) { let context = global.create_app_launch_context(event.get_time(), -1); Gio.AppInfo.launch_default_for_uri(this.mount.get_root().get_uri(), context); @@ -121,7 +121,7 @@ const DriveMenu = new Lang.Class({ Name: 'DriveMenu.DriveMenu', Extends: PanelMenu.Button, - _init: function() { + _init() { this.parent(0.0, _("Removable devices")); let hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' }); @@ -156,20 +156,20 @@ const DriveMenu = new Lang.Class({ this._updateMenuVisibility(); }, - _updateMenuVisibility: function() { + _updateMenuVisibility() { if (this._mounts.filter(i => i.actor.visible).length > 0) this.actor.show(); else this.actor.hide(); }, - _addMount: function(mount) { + _addMount(mount) { let item = new MountMenuItem(mount); this._mounts.unshift(item); this.menu.addMenuItem(item, 0); }, - _removeMount: function(mount) { + _removeMount(mount) { for (let i = 0; i < this._mounts.length; i++) { let item = this._mounts[i]; if (item.mount == mount) { @@ -181,7 +181,7 @@ const DriveMenu = new Lang.Class({ log ('Removing a mount that was never added to the menu'); }, - destroy: function() { + destroy() { if (this._connectedId) { this._monitor.disconnect(this._connectedId); this._monitor.disconnect(this._disconnectedId); diff --git a/extensions/example/prefs.js b/extensions/example/prefs.js index c40e8094..40ff041d 100644 --- a/extensions/example/prefs.js +++ b/extensions/example/prefs.js @@ -21,7 +21,7 @@ const ExamplePrefsWidget = new GObject.Class({ GTypeName: 'ExamplePrefsWidget', Extends: Gtk.Grid, - _init: function(params) { + _init(params) { this.parent(params); this.margin = 12; this.row_spacing = this.column_spacing = 6; diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index 0796bf03..8a479cc8 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -17,18 +17,18 @@ const WINDOW_PLACEMENT_NATURAL_MAX_TRANSLATIONS = 5000; // safety li const Rect = new Lang.Class({ Name: 'NativeWindowPlacement.Rect', - _init: function(x, y, width, height) { + _init(x, y, width, height) { [this.x, this.y, this.width, this.height] = [x, y, width, height]; }, /** * used in _calculateWindowTransformationsNatural to replace Meta.Rectangle that is too slow. */ - copy: function() { + copy() { return new Rect(this.x, this.y, this.width, this.height); }, - union: function(rect2) { + union(rect2) { let dest = this.copy(); if (rect2.x < dest.x) { @@ -48,7 +48,7 @@ const Rect = new Lang.Class({ return dest; }, - adjusted: function(dx, dy, dx2, dy2) { + adjusted(dx, dy, dx2, dy2) { let dest = this.copy(); dest.x += dx; dest.y += dy; @@ -57,18 +57,18 @@ const Rect = new Lang.Class({ return dest; }, - overlap: function(rect2) { + overlap(rect2) { return !((this.x + this.width <= rect2.x) || (rect2.x + rect2.width <= this.x) || (this.y + this.height <= rect2.y) || (rect2.y + rect2.height <= this.y)); }, - center: function() { + center() { return [this.x + this.width / 2, this.y + this.height / 2]; }, - translate: function(dx, dy) { + translate(dx, dy) { this.x += dx; this.y += dy; } @@ -78,11 +78,11 @@ const NaturalLayoutStrategy = new Lang.Class({ Name: 'NaturalLayoutStrategy', Extends: Workspace.LayoutStrategy, - _init: function(settings) { + _init(settings) { this._settings = settings; }, - computeLayout: function(windows, layout) { + computeLayout(windows, layout) { layout.windows = windows; }, @@ -92,7 +92,7 @@ const NaturalLayoutStrategy = new Lang.Class({ * PresentWindowsEffect::calculateWindowTransformationsNatural() from KDE, see: * https://projects.kde.org/projects/kde/kdebase/kde-workspace/repository/revisions/master/entry/kwin/effects/presentwindows/presentwindows.cpp */ - computeWindowSlots: function(layout, area) { + computeWindowSlots(layout, area) { // As we are using pseudo-random movement (See "slot") we need to make sure the list // is always sorted the same way no matter which window is currently active. diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index d26b9b75..0a8bd5e3 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -27,7 +27,7 @@ const PlaceMenuItem = new Lang.Class({ Name: 'PlaceMenuItem', Extends: PopupMenu.PopupBaseMenuItem, - _init: function(info) { + _init(info) { this.parent(); this._info = info; @@ -50,7 +50,7 @@ const PlaceMenuItem = new Lang.Class({ Lang.bind(this, this._propertiesChanged)); }, - destroy: function() { + destroy() { if (this._changedId) { this._info.disconnect(this._changedId); this._changedId = 0; @@ -59,13 +59,13 @@ const PlaceMenuItem = new Lang.Class({ this.parent(); }, - activate: function(event) { + activate(event) { this._info.launch(event.get_time()); this.parent(event); }, - _propertiesChanged: function(info) { + _propertiesChanged(info) { this._icon.gicon = info.icon; this._label.text = info.name; }, @@ -82,7 +82,7 @@ const PlacesMenu = new Lang.Class({ Name: 'PlacesMenu.PlacesMenu', Extends: PanelMenu.Button, - _init: function() { + _init() { this.parent(0.0, _("Places")); let hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' }); @@ -110,18 +110,18 @@ const PlacesMenu = new Lang.Class({ } }, - destroy: function() { + destroy() { this.placesManager.destroy(); this.parent(); }, - _redisplay: function(id) { + _redisplay(id) { this._sections[id].removeAll(); this._create(id); }, - _create: function(id) { + _create(id) { let places = this.placesManager.get(id); for (let i = 0; i < places.length; i++) diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index 7804335d..46ec011e 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -31,21 +31,21 @@ const Hostname1 = Gio.DBusProxy.makeProxyWrapper(Hostname1Iface); const PlaceInfo = new Lang.Class({ Name: 'PlaceInfo', - _init: function(kind, file, name, icon) { + _init(kind, file, name, icon) { this.kind = kind; this.file = file; this.name = name || this._getFileName(); this.icon = icon ? new Gio.ThemedIcon({ name: icon }) : this.getIcon(); }, - destroy: function() { + destroy() { }, - isRemovable: function() { + isRemovable() { return false; }, - _createLaunchCallback: function(launchContext, tryMount) { + _createLaunchCallback(launchContext, tryMount) { return (_ignored, result) => { try { Gio.AppInfo.launch_default_for_uri_finish(result); @@ -80,7 +80,7 @@ const PlaceInfo = new Lang.Class({ } }, - launch: function(timestamp) { + launch(timestamp) { let launchContext = global.create_app_launch_context(timestamp, -1); let callback = this._createLaunchCallback(launchContext, true); Gio.AppInfo.launch_default_for_uri_async(this.file.get_uri(), @@ -89,7 +89,7 @@ const PlaceInfo = new Lang.Class({ callback); }, - getIcon: function() { + getIcon() { this.file.query_info_async('standard::symbolic-icon', 0, 0, null, (file, result) => { try { @@ -118,7 +118,7 @@ const PlaceInfo = new Lang.Class({ } }, - _getFileName: function() { + _getFileName() { try { let info = this.file.query_info('standard::display-name', 0, null); return info.get_display_name(); @@ -133,7 +133,7 @@ const RootInfo = new Lang.Class({ Name: 'RootInfo', Extends: PlaceInfo, - _init: function() { + _init() { this.parent('devices', Gio.File.new_for_path('/'), _("Computer")); this._proxy = new Hostname1(Gio.DBus.system, @@ -149,11 +149,11 @@ const RootInfo = new Lang.Class({ }); }, - getIcon: function() { + getIcon() { return new Gio.ThemedIcon({ name: 'drive-harddisk-symbolic' }); }, - _propertiesChanged: function(proxy) { + _propertiesChanged(proxy) { // GDBusProxy will emit a g-properties-changed when hostname1 goes down // ignore it if (proxy.g_name_owner) { @@ -162,7 +162,7 @@ const RootInfo = new Lang.Class({ } }, - destroy: function() { + destroy() { this._proxy.run_dispose(); this.parent(); } @@ -173,20 +173,20 @@ const PlaceDeviceInfo = new Lang.Class({ Name: 'PlaceDeviceInfo', Extends: PlaceInfo, - _init: function(kind, mount) { + _init(kind, mount) { this._mount = mount; this.parent(kind, mount.get_root(), mount.get_name()); }, - getIcon: function() { + getIcon() { return this._mount.get_symbolic_icon(); }, - isRemovable: function() { + isRemovable() { return this._mount.can_eject(); }, - eject: function() { + eject() { let mountOp = new ShellMountOperation.ShellMountOperation(this._mount); if (this._mount.can_eject()) @@ -201,7 +201,7 @@ const PlaceDeviceInfo = new Lang.Class({ Lang.bind(this, this._unmountFinish)); }, - _ejectFinish: function(mount, result) { + _ejectFinish(mount, result) { try { mount.eject_with_operation_finish(result); } catch(e) { @@ -209,7 +209,7 @@ const PlaceDeviceInfo = new Lang.Class({ } }, - _unmountFinish: function(mount, result) { + _unmountFinish(mount, result) { try { mount.unmount_with_operation_finish(result); } catch(e) { @@ -217,7 +217,7 @@ const PlaceDeviceInfo = new Lang.Class({ } }, - _reportFailure: function(exception) { + _reportFailure(exception) { let msg = _("Ejecting drive “%s” failed:").format(this._mount.get_name()); Main.notifyError(msg, exception.message); } @@ -227,12 +227,12 @@ const PlaceVolumeInfo = new Lang.Class({ Name: 'PlaceVolumeInfo', Extends: PlaceInfo, - _init: function(kind, volume) { + _init(kind, volume) { this._volume = volume; this.parent(kind, volume.get_activation_root(), volume.get_name()); }, - launch: function(timestamp) { + launch(timestamp) { if (this.file) { this.parent(timestamp); return; @@ -247,7 +247,7 @@ const PlaceVolumeInfo = new Lang.Class({ }); }, - getIcon: function() { + getIcon() { return this._volume.get_symbolic_icon(); } }); @@ -263,7 +263,7 @@ const DEFAULT_DIRECTORIES = [ var PlacesManager = new Lang.Class({ Name: 'PlacesManager', - _init: function() { + _init() { this._places = { special: [], devices: [], @@ -305,7 +305,7 @@ var PlacesManager = new Lang.Class({ } }, - _connectVolumeMonitorSignals: function() { + _connectVolumeMonitorSignals() { const signals = ['volume-added', 'volume-removed', 'volume-changed', 'mount-added', 'mount-removed', 'mount-changed', 'drive-connected', 'drive-disconnected', 'drive-changed']; @@ -318,7 +318,7 @@ var PlacesManager = new Lang.Class({ } }, - destroy: function() { + destroy() { if (this._settings) this._settings.disconnect(this._showDesktopIconsChangedId); this._settings = null; @@ -332,7 +332,7 @@ var PlacesManager = new Lang.Class({ Mainloop.source_remove(this._bookmarkTimeoutId); }, - _updateSpecials: function() { + _updateSpecials() { this._places.special.forEach(p => { p.destroy(); }); this._places.special = []; @@ -369,7 +369,7 @@ var PlacesManager = new Lang.Class({ this.emit('special-updated'); }, - _updateMounts: function() { + _updateMounts() { let networkMounts = []; let networkVolumes = []; @@ -452,7 +452,7 @@ var PlacesManager = new Lang.Class({ this.emit('network-updated'); }, - _findBookmarksFile: function() { + _findBookmarksFile() { let paths = [ GLib.build_filenamev([GLib.get_user_config_dir(), 'gtk-3.0', 'bookmarks']), GLib.build_filenamev([GLib.get_home_dir(), '.gtk-bookmarks']), @@ -466,7 +466,7 @@ var PlacesManager = new Lang.Class({ return null; }, - _reloadBookmarks: function() { + _reloadBookmarks() { this._bookmarks = []; @@ -516,7 +516,7 @@ var PlacesManager = new Lang.Class({ this.emit('bookmarks-updated'); }, - _addMount: function(kind, mount) { + _addMount(kind, mount) { let devItem; try { @@ -528,7 +528,7 @@ var PlacesManager = new Lang.Class({ this._places[kind].push(devItem); }, - _addVolume: function(kind, volume) { + _addVolume(kind, volume) { let volItem; try { @@ -540,7 +540,7 @@ var PlacesManager = new Lang.Class({ this._places[kind].push(volItem); }, - get: function(kind) { + get(kind) { return this._places[kind]; } }); diff --git a/extensions/user-theme/extension.js b/extensions/user-theme/extension.js index b36d36a5..13dc4570 100644 --- a/extensions/user-theme/extension.js +++ b/extensions/user-theme/extension.js @@ -15,16 +15,16 @@ const Convenience = Me.imports.convenience; const ThemeManager = new Lang.Class({ Name: 'UserTheme.ThemeManager', - _init: function() { + _init() { this._settings = Convenience.getSettings(); }, - enable: function() { + enable() { this._changedId = this._settings.connect('changed::'+SETTINGS_KEY, Lang.bind(this, this._changeTheme)); this._changeTheme(); }, - disable: function() { + disable() { if (this._changedId) { this._settings.disconnect(this._changedId); this._changedId = 0; @@ -34,7 +34,7 @@ const ThemeManager = new Lang.Class({ Main.loadTheme(); }, - _changeTheme: function() { + _changeTheme() { let _stylesheet = null; let _themeName = this._settings.get_string(SETTINGS_KEY); diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 9f34b312..5a5ce952 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -68,7 +68,7 @@ const WindowContextMenu = new Lang.Class({ Name: 'WindowContextMenu', Extends: PopupMenu.PopupMenu, - _init: function(source, metaWindow) { + _init(source, metaWindow) { this.parent(source, 0.5, St.Side.BOTTOM); this._metaWindow = metaWindow; @@ -125,19 +125,19 @@ const WindowContextMenu = new Lang.Class({ }); }, - _updateMinimizeItem: function() { + _updateMinimizeItem() { this._minimizeItem.label.text = this._metaWindow.minimized ? _("Unminimize") : _("Minimize"); }, - _updateMaximizeItem: function() { + _updateMaximizeItem() { let maximized = this._metaWindow.maximized_vertically && this._metaWindow.maximized_horizontally; this._maximizeItem.label.text = maximized ? _("Unmaximize") : _("Maximize"); }, - _onDestroy: function() { + _onDestroy() { this._metaWindow.disconnect(this._notifyMinimizedId); this._metaWindow.disconnect(this._notifyMaximizedHId); this._metaWindow.disconnect(this._notifyMaximizedVId); @@ -147,7 +147,7 @@ const WindowContextMenu = new Lang.Class({ const WindowTitle = new Lang.Class({ Name: 'WindowTitle', - _init: function(metaWindow) { + _init(metaWindow) { this._metaWindow = metaWindow; this.actor = new St.BoxLayout({ style_class: 'window-button-box', x_expand: true, y_expand: true }); @@ -180,12 +180,12 @@ const WindowTitle = new Lang.Class({ this._minimizedChanged(); }, - _minimizedChanged: function() { + _minimizedChanged() { this._icon.opacity = this._metaWindow.minimized ? 128 : 255; this._updateTitle(); }, - _updateTitle: function() { + _updateTitle() { if (!this._metaWindow.title) return; @@ -195,7 +195,7 @@ const WindowTitle = new Lang.Class({ this.label_actor.text = this._metaWindow.title; }, - _updateIcon: function() { + _updateIcon() { let app = Shell.WindowTracker.get_default().get_window_app(this._metaWindow); if (app) this._icon.child = app.create_icon_texture(ICON_TEXTURE_SIZE); @@ -204,7 +204,7 @@ const WindowTitle = new Lang.Class({ icon_size: ICON_TEXTURE_SIZE }); }, - _onDestroy: function() { + _onDestroy() { this._textureCache.disconnect(this._iconThemeChangedId); this._metaWindow.disconnect(this._notifyTitleId); this._metaWindow.disconnect(this._notifyMinimizedId); @@ -218,7 +218,7 @@ const BaseButton = new Lang.Class({ Name: 'BaseButton', Abstract: true, - _init: function(perMonitor, monitorIndex) { + _init(perMonitor, monitorIndex) { this._perMonitor = perMonitor; this._monitorIndex = monitorIndex; @@ -256,43 +256,43 @@ const BaseButton = new Lang.Class({ return this.actor.has_style_class_name('focused'); }, - activate: function() { + activate() { if (this.active) return; this._onClicked(this.actor, 1); }, - _onClicked: function(actor, button) { + _onClicked(actor, button) { throw new Error('Not implemented'); }, - _canOpenPopupMenu: function() { + _canOpenPopupMenu() { return true; }, - _onPopupMenu: function(actor) { + _onPopupMenu(actor) { if (!this._canOpenPopupMenu() || this._contextMenu.isOpen) return; _openMenu(this._contextMenu); }, - _isFocused: function() { + _isFocused() { throw new Error('Not implemented'); }, - _updateStyle: function() { + _updateStyle() { if (this._isFocused()) this.actor.add_style_class_name('focused'); else this.actor.remove_style_class_name('focused'); }, - _windowEnteredOrLeftMonitor: function(metaScreen, monitorIndex, metaWindow) { + _windowEnteredOrLeftMonitor(metaScreen, monitorIndex, metaWindow) { throw new Error('Not implemented'); }, - _isWindowVisible: function(window) { + _isWindowVisible(window) { let workspace = global.screen.get_active_workspace(); return !window.skip_taskbar && @@ -300,11 +300,11 @@ const BaseButton = new Lang.Class({ (!this._perMonitor || window.get_monitor() == this._monitorIndex); }, - _updateVisibility: function() { + _updateVisibility() { throw new Error('Not implemented'); }, - _getIconGeometry: function() { + _getIconGeometry() { let rect = new Meta.Rectangle(); [rect.x, rect.y] = this.actor.get_transformed_position(); @@ -313,11 +313,11 @@ const BaseButton = new Lang.Class({ return rect; }, - _updateIconGeometry: function() { + _updateIconGeometry() { throw new Error('Not implemented'); }, - _onDestroy: function() { + _onDestroy() { global.window_manager.disconnect(this._switchWorkspaceId); if (this._windowEnteredMonitorId) @@ -335,7 +335,7 @@ const WindowButton = new Lang.Class({ Name: 'WindowButton', Extends: BaseButton, - _init: function(metaWindow, perMonitor, monitorIndex) { + _init(metaWindow, perMonitor, monitorIndex) { this.parent(perMonitor, monitorIndex); this.metaWindow = metaWindow; @@ -361,7 +361,7 @@ const WindowButton = new Lang.Class({ this._updateStyle(); }, - _onClicked: function(actor, button) { + _onClicked(actor, button) { if (this._contextMenu.isOpen) { this._contextMenu.close(); return; @@ -373,11 +373,11 @@ const WindowButton = new Lang.Class({ _openMenu(this._contextMenu); }, - _isFocused: function() { + _isFocused() { return global.display.focus_window == this.metaWindow; }, - _updateStyle: function() { + _updateStyle() { this.parent(); if (this.metaWindow.minimized) @@ -386,20 +386,20 @@ const WindowButton = new Lang.Class({ this.actor.remove_style_class_name('minimized'); }, - _windowEnteredOrLeftMonitor: function(metaScreen, monitorIndex, metaWindow) { + _windowEnteredOrLeftMonitor(metaScreen, monitorIndex, metaWindow) { if (monitorIndex == this._monitorIndex && metaWindow == this.metaWindow) this._updateVisibility(); }, - _updateVisibility: function() { + _updateVisibility() { this.actor.visible = this._isWindowVisible(this.metaWindow); }, - _updateIconGeometry: function() { + _updateIconGeometry() { this.metaWindow.set_icon_geometry(this._getIconGeometry()); }, - _onDestroy: function() { + _onDestroy() { this.parent(); this.metaWindow.disconnect(this._workspaceChangedId); global.display.disconnect(this._notifyFocusId); @@ -412,7 +412,7 @@ const AppContextMenu = new Lang.Class({ Name: 'AppContextMenu', Extends: PopupMenu.PopupMenu, - _init: function(source, appButton) { + _init(source, appButton) { this.parent(source, 0.5, St.Side.BOTTOM); this._appButton = appButton; @@ -456,7 +456,7 @@ const AppContextMenu = new Lang.Class({ this.addMenuItem(item); }, - open: function(animate) { + open(animate) { let windows = this._appButton.getWindowList(); this._minimizeItem.actor.visible = windows.some(w => !w.minimized); this._unminimizeItem.actor.visible = windows.some(w => w.minimized); @@ -475,7 +475,7 @@ const AppButton = new Lang.Class({ Name: 'AppButton', Extends: BaseButton, - _init: function(app, perMonitor, monitorIndex) { + _init(app, perMonitor, monitorIndex) { this.parent(perMonitor, monitorIndex); this.app = app; @@ -533,7 +533,7 @@ const AppButton = new Lang.Class({ this._updateStyle(); }, - _windowEnteredOrLeftMonitor: function(metaScreen, monitorIndex, metaWindow) { + _windowEnteredOrLeftMonitor(metaScreen, monitorIndex, metaWindow) { if (this._windowTracker.get_window_app(metaWindow) == this.app && monitorIndex == this._monitorIndex) { this._updateVisibility(); @@ -541,7 +541,7 @@ const AppButton = new Lang.Class({ } }, - _updateVisibility: function() { + _updateVisibility() { if (!this._perMonitor) { // fast path: use ShellApp API to avoid iterating over all windows. let workspace = global.screen.get_active_workspace(); @@ -551,22 +551,22 @@ const AppButton = new Lang.Class({ } }, - _isFocused: function() { + _isFocused() { return this._windowTracker.focus_app == this.app; }, - _updateIconGeometry: function() { + _updateIconGeometry() { let rect = this._getIconGeometry(); let windows = this.app.get_windows(); windows.forEach(w => { w.set_icon_geometry(rect); }); }, - getWindowList: function() { + getWindowList() { return this.app.get_windows().filter(win => this._isWindowVisible(win)); }, - _windowsChanged: function() { + _windowsChanged() { let windows = this.getWindowList(); this._singleWindowTitle.visible = windows.length == 1; this._multiWindowTitle.visible = !this._singleWindowTitle.visible; @@ -601,7 +601,7 @@ const AppButton = new Lang.Class({ }, - _onClicked: function(actor, button) { + _onClicked(actor, button) { let menuWasOpen = this._menu.isOpen; if (menuWasOpen) this._menu.close(); @@ -638,15 +638,15 @@ const AppButton = new Lang.Class({ } }, - _canOpenPopupMenu: function() { + _canOpenPopupMenu() { return !this._menu.isOpen; }, - _onMenuActivate: function(menu, child) { + _onMenuActivate(menu, child) { child._window.activate(global.get_current_time()); }, - _onDestroy: function() { + _onDestroy() { this.parent(); this._textureCache.disconnect(this._iconThemeChangedId); this._windowTracker.disconnect(this._notifyFocusId); @@ -660,7 +660,7 @@ const WorkspaceIndicator = new Lang.Class({ Name: 'WindowList.WorkspaceIndicator', Extends: PanelMenu.Button, - _init: function() { + _init() { this.parent(0.0, _("Workspace Indicator"), true); this.setMenu(new PopupMenu.PopupMenu(this.actor, 0.0, St.Side.BOTTOM)); this.actor.add_style_class_name('window-list-workspace-indicator'); @@ -689,7 +689,7 @@ const WorkspaceIndicator = new Lang.Class({ this._settingsChangedId = this._settings.connect('changed::workspace-names', Lang.bind(this, this._updateMenu)); }, - destroy: function() { + destroy() { for (let i = 0; i < this._screenSignals.length; i++) global.screen.disconnect(this._screenSignals[i]); @@ -701,7 +701,7 @@ const WorkspaceIndicator = new Lang.Class({ this.parent(); }, - _updateIndicator: function() { + _updateIndicator() { this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.NONE); this._currentWorkspace = global.screen.get_active_workspace().index(); this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.DOT); @@ -709,14 +709,14 @@ const WorkspaceIndicator = new Lang.Class({ this.statusLabel.set_text(this._getStatusText()); }, - _getStatusText: function() { + _getStatusText() { let current = global.screen.get_active_workspace().index(); let total = global.screen.n_workspaces; return '%d / %d'.format(current + 1, total); }, - _updateMenu: function() { + _updateMenu() { this.menu.removeAll(); this.workspacesItems = []; this._currentWorkspace = global.screen.get_active_workspace().index(); @@ -740,14 +740,14 @@ const WorkspaceIndicator = new Lang.Class({ this.statusLabel.set_text(this._getStatusText()); }, - _activate: function(index) { + _activate(index) { if(index >= 0 && index < global.screen.n_workspaces) { let metaWorkspace = global.screen.get_workspace_by_index(index); metaWorkspace.activate(global.get_current_time()); } }, - _onScrollEvent: function(actor, event) { + _onScrollEvent(actor, event) { let direction = event.get_scroll_direction(); let diff = 0; if (direction == Clutter.ScrollDirection.DOWN) { @@ -762,7 +762,7 @@ const WorkspaceIndicator = new Lang.Class({ this._activate(newIndex); }, - _allocate: function(actor, box, flags) { + _allocate(actor, box, flags) { if (actor.get_n_children() > 0) actor.get_first_child().allocate(box, flags); } @@ -771,7 +771,7 @@ const WorkspaceIndicator = new Lang.Class({ const WindowList = new Lang.Class({ Name: 'WindowList', - _init: function(perMonitor, monitor) { + _init(perMonitor, monitor) { this._perMonitor = perMonitor; this._monitor = monitor; @@ -897,20 +897,20 @@ const WindowList = new Lang.Class({ this._groupingModeChanged(); }, - _getDynamicWorkspacesSettings: function() { + _getDynamicWorkspacesSettings() { if (this._workspaceSettings.list_keys().indexOf('dynamic-workspaces') > -1) return this._workspaceSettings; return this._mutterSettings; }, - _getWorkspaceSettings: function() { + _getWorkspaceSettings() { let settings = global.get_overrides_settings(); if (settings.list_keys().indexOf('workspaces-only-on-primary') > -1) return settings; return this._mutterSettings; }, - _onScrollEvent: function(actor, event) { + _onScrollEvent(actor, event) { let direction = event.get_scroll_direction(); let diff = 0; if (direction == Clutter.ScrollDirection.DOWN) @@ -933,12 +933,12 @@ const WindowList = new Lang.Class({ children[active].activate(); }, - _updatePosition: function() { + _updatePosition() { this.actor.set_position(this._monitor.x, this._monitor.y + this._monitor.height - this.actor.height); }, - _updateWorkspaceIndicatorVisibility: function() { + _updateWorkspaceIndicatorVisibility() { let hasWorkspaces = this._dynamicWorkspacesSettings.get_boolean('dynamic-workspaces') || global.screen.n_workspaces > 1; let workspacesOnMonitor = this._monitor == Main.layoutManager.primaryMonitor || @@ -947,7 +947,7 @@ const WindowList = new Lang.Class({ this._workspaceIndicator.actor.visible = hasWorkspaces && workspacesOnMonitor; }, - _getPreferredUngroupedWindowListWidth: function() { + _getPreferredUngroupedWindowListWidth() { if (this._windowList.get_n_children() == 0) return this._windowList.get_preferred_width(-1)[1]; @@ -966,12 +966,12 @@ const WindowList = new Lang.Class({ return nWindows * childWidth + (nWindows - 1) * spacing; }, - _getMaxWindowListWidth: function() { + _getMaxWindowListWidth() { let indicatorsBox = this._workspaceIndicator.actor.get_parent(); return this.actor.width - indicatorsBox.get_preferred_width(-1)[1]; }, - _groupingModeChanged: function() { + _groupingModeChanged() { this._groupingMode = this._settings.get_enum('grouping-mode'); if (this._groupingMode == GroupingMode.AUTO) { @@ -982,7 +982,7 @@ const WindowList = new Lang.Class({ } }, - _checkGrouping: function() { + _checkGrouping() { if (this._groupingMode != GroupingMode.AUTO) return; @@ -996,7 +996,7 @@ const WindowList = new Lang.Class({ } }, - _populateWindowList: function() { + _populateWindowList() { this._windowList.destroy_all_children(); if (!this._grouped) { @@ -1016,7 +1016,7 @@ const WindowList = new Lang.Class({ } }, - _updateKeyboardAnchor: function() { + _updateKeyboardAnchor() { if (!Main.keyboard.actor) return; @@ -1024,7 +1024,7 @@ const WindowList = new Lang.Class({ Main.keyboard.actor.anchor_y = anchorY; }, - _onAppStateChanged: function(appSys, app) { + _onAppStateChanged(appSys, app) { if (!this._grouped) return; @@ -1034,7 +1034,7 @@ const WindowList = new Lang.Class({ this._removeApp(app); }, - _addApp: function(app) { + _addApp(app) { let button = new AppButton(app, this._perMonitor, this._monitor.index); this._windowList.layout_manager.pack(button.actor, true, true, true, @@ -1042,7 +1042,7 @@ const WindowList = new Lang.Class({ Clutter.BoxAlignment.START); }, - _removeApp: function(app) { + _removeApp(app) { let children = this._windowList.get_children(); for (let i = 0; i < children.length; i++) { if (children[i]._delegate.app == app) { @@ -1052,7 +1052,7 @@ const WindowList = new Lang.Class({ } }, - _onWindowAdded: function(ws, win) { + _onWindowAdded(ws, win) { if (win.skip_taskbar) return; @@ -1075,7 +1075,7 @@ const WindowList = new Lang.Class({ Clutter.BoxAlignment.START); }, - _onWindowRemoved: function(ws, win) { + _onWindowRemoved(ws, win) { if (this._grouped) this._checkGrouping(); @@ -1094,7 +1094,7 @@ const WindowList = new Lang.Class({ } }, - _onWorkspacesChanged: function() { + _onWorkspacesChanged() { let numWorkspaces = global.screen.n_workspaces; for (let i = 0; i < numWorkspaces; i++) { let workspace = global.screen.get_workspace_by_index(i); @@ -1114,7 +1114,7 @@ const WindowList = new Lang.Class({ this._updateWorkspaceIndicatorVisibility(); }, - _disconnectWorkspaceSignals: function() { + _disconnectWorkspaceSignals() { let numWorkspaces = global.screen.n_workspaces; for (let i = 0; i < numWorkspaces; i++) { let workspace = global.screen.get_workspace_by_index(i); @@ -1125,16 +1125,16 @@ const WindowList = new Lang.Class({ } }, - _onDragBegin: function() { + _onDragBegin() { DND.addDragMonitor(this._dragMonitor); }, - _onDragEnd: function() { + _onDragEnd() { DND.removeDragMonitor(this._dragMonitor); this._removeActivateTimeout(); }, - _onDragMotion: function(dragEvent) { + _onDragMotion(dragEvent) { if (Main.overview.visible || !this.actor.contains(dragEvent.targetActor)) { this._removeActivateTimeout(); @@ -1159,14 +1159,14 @@ const WindowList = new Lang.Class({ return DND.DragMotionResult.CONTINUE; }, - _removeActivateTimeout: function() { + _removeActivateTimeout() { if (this._dndTimeoutId) GLib.source_remove (this._dndTimeoutId); this._dndTimeoutId = 0; this._dndWindow = null; }, - _activateWindow: function() { + _activateWindow() { let [x, y] = global.get_pointer(); let pickedActor = global.stage.get_actor_at_pos(Clutter.PickMode.ALL, x, y); @@ -1178,7 +1178,7 @@ const WindowList = new Lang.Class({ return false; }, - _onDestroy: function() { + _onDestroy() { this._workspaceSettings.disconnect(this._workspacesOnlyOnPrimaryChangedId); this._dynamicWorkspacesSettings.disconnect(this._dynamicWorkspacesChangedId); @@ -1221,12 +1221,12 @@ const WindowList = new Lang.Class({ const Extension = new Lang.Class({ Name: 'Extension', - _init: function() { + _init() { this._windowLists = null; this._injections = {}; }, - enable: function() { + enable() { this._windowLists = []; this._settings = Convenience.getSettings(); @@ -1241,7 +1241,7 @@ const Extension = new Lang.Class({ this._buildWindowLists(); }, - _buildWindowLists: function() { + _buildWindowLists() { this._windowLists.forEach(list => { list.actor.destroy(); }); this._windowLists = []; @@ -1253,7 +1253,7 @@ const Extension = new Lang.Class({ }); }, - disable: function() { + disable() { if (!this._windowLists) return; @@ -1270,7 +1270,7 @@ const Extension = new Lang.Class({ this._windowLists = null; }, - someWindowListContains: function(actor) { + someWindowListContains(actor) { return this._windowLists.some(list => list.actor.contains(actor)); } }); diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js index e7026ad9..c5e13ee7 100644 --- a/extensions/window-list/prefs.js +++ b/extensions/window-list/prefs.js @@ -21,7 +21,7 @@ const WindowListPrefsWidget = new GObject.Class({ GTypeName: 'WindowListPrefsWidget', Extends: Gtk.Grid, - _init: function(params) { + _init(params) { this.parent(params); this.margin = 24; diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index 810ffb6c..eb4cfe13 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -26,7 +26,7 @@ const WorkspaceIndicator = new Lang.Class({ Name: 'WorkspaceIndicator.WorkspaceIndicator', Extends: PanelMenu.Button, - _init: function() { + _init() { this.parent(0.0, _("Workspace Indicator")); this._currentWorkspace = global.screen.get_active_workspace().index(); @@ -54,7 +54,7 @@ const WorkspaceIndicator = new Lang.Class({ this._settingsChangedId = this._settings.connect('changed::' + WORKSPACE_KEY, Lang.bind(this, this._createWorkspacesSection)); }, - destroy: function() { + destroy() { for (let i = 0; i < this._screenSignals.length; i++) global.screen.disconnect(this._screenSignals[i]); @@ -66,7 +66,7 @@ const WorkspaceIndicator = new Lang.Class({ this.parent(); }, - _updateIndicator: function() { + _updateIndicator() { this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.NONE); this._currentWorkspace = global.screen.get_active_workspace().index(); this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.DOT); @@ -74,7 +74,7 @@ const WorkspaceIndicator = new Lang.Class({ this.statusLabel.set_text(this._labelText()); }, - _labelText: function(workspaceIndex) { + _labelText(workspaceIndex) { if(workspaceIndex == undefined) { workspaceIndex = this._currentWorkspace; return (workspaceIndex + 1).toString(); @@ -82,7 +82,7 @@ const WorkspaceIndicator = new Lang.Class({ return Meta.prefs_get_workspace_name(workspaceIndex); }, - _createWorkspacesSection: function() { + _createWorkspacesSection() { this._workspaceSection.removeAll(); this.workspacesItems = []; this._currentWorkspace = global.screen.get_active_workspace().index(); @@ -105,14 +105,14 @@ const WorkspaceIndicator = new Lang.Class({ this.statusLabel.set_text(this._labelText()); }, - _activate: function(index) { + _activate(index) { if(index >= 0 && index < global.screen.n_workspaces) { let metaWorkspace = global.screen.get_workspace_by_index(index); metaWorkspace.activate(global.get_current_time()); } }, - _onScrollEvent: function(actor, event) { + _onScrollEvent(actor, event) { let direction = event.get_scroll_direction(); let diff = 0; if (direction == Clutter.ScrollDirection.DOWN) { diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index 5913ab39..3dbde708 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -26,7 +26,7 @@ const WorkspaceNameModel = new GObject.Class({ LABEL: 0, }, - _init: function(params) { + _init(params) { this.parent(params); this.set_column_types([GObject.TYPE_STRING]); @@ -42,7 +42,7 @@ const WorkspaceNameModel = new GObject.Class({ this.connect('row-deleted', Lang.bind(this, this._onRowDeleted)); }, - _reloadFromSettings: function() { + _reloadFromSettings() { if (this._preventChanges) return; this._preventChanges = true; @@ -69,7 +69,7 @@ const WorkspaceNameModel = new GObject.Class({ this._preventChanges = false; }, - _onRowChanged: function(self, path, iter) { + _onRowChanged(self, path, iter) { if (this._preventChanges) return; this._preventChanges = true; @@ -90,7 +90,7 @@ const WorkspaceNameModel = new GObject.Class({ this._preventChanges = false; }, - _onRowInserted: function(self, path, iter) { + _onRowInserted(self, path, iter) { if (this._preventChanges) return; this._preventChanges = true; @@ -105,7 +105,7 @@ const WorkspaceNameModel = new GObject.Class({ this._preventChanges = false; }, - _onRowDeleted: function(self, path) { + _onRowDeleted(self, path) { if (this._preventChanges) return; this._preventChanges = true; @@ -133,7 +133,7 @@ const WorkspaceSettingsWidget = new GObject.Class({ GTypeName: 'WorkspaceSettingsWidget', Extends: Gtk.Grid, - _init: function(params) { + _init(params) { this.parent(params); this.margin = 12; this.orientation = Gtk.Orientation.VERTICAL; @@ -183,14 +183,14 @@ const WorkspaceSettingsWidget = new GObject.Class({ this.add(toolbar); }, - _cellEdited: function(renderer, path, new_text) { + _cellEdited(renderer, path, new_text) { let [ok, iter] = this._store.get_iter_from_string(path); if (ok) this._store.set(iter, [this._store.Columns.LABEL], [new_text]); }, - _newClicked: function() { + _newClicked() { let iter = this._store.append(); let index = this._store.get_path(iter).get_indices()[0]; @@ -198,7 +198,7 @@ const WorkspaceSettingsWidget = new GObject.Class({ this._store.set(iter, [this._store.Columns.LABEL], [label]); }, - _delClicked: function() { + _delClicked() { let [any, model, iter] = this._treeView.get_selection().get_selected(); if (any) From 48399d46c06fe2d1070aa6fc19e6d37f3003b97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 27 Oct 2017 17:29:48 +0200 Subject: [PATCH 32/60] cleanup: Port non-GObject classes to ES6 classes ES6 finally adds standard class syntax to the language, so we can replace our custom Lang.Class framework with the new syntax. Any classes that inherit from GObject will need special treatment, so limit the port to regular javascript classes for now. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30 --- extensions/apps-menu/extension.js | 173 ++++++------- extensions/auto-move-windows/extension.js | 14 +- extensions/drive-menu/extension.js | 54 ++-- .../native-window-placement/extension.js | 36 ++- extensions/places-menu/extension.js | 42 ++- extensions/places-menu/placeDisplay.js | 103 ++++---- extensions/user-theme/extension.js | 14 +- extensions/window-list/extension.js | 245 ++++++++---------- extensions/workspace-indicator/extension.js | 27 +- 9 files changed, 318 insertions(+), 390 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index ebd90dc3..d5d8af7a 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -31,29 +31,23 @@ const HORIZ_FACTOR = 5; const MENU_HEIGHT_OFFSET = 132; const NAVIGATION_REGION_OVERSHOOT = 50; -const ActivitiesMenuItem = new Lang.Class({ - Name: 'ActivitiesMenuItem', - Extends: PopupMenu.PopupBaseMenuItem, - - _init(button) { - this.parent(); +class ActivitiesMenuItem extends PopupMenu.PopupBaseMenuItem { + constructor(button) { + super(); this._button = button; this.actor.add_child(new St.Label({ text: _("Activities Overview") })); - }, + } activate(event) { this._button.menu.toggle(); Main.overview.toggle(); - this.parent(event); - }, -}); + super.activate(event); + } +}; -const ApplicationMenuItem = new Lang.Class({ - Name: 'ApplicationMenuItem', - Extends: PopupMenu.PopupBaseMenuItem, - - _init(button, app) { - this.parent(); +class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem { + constructor(button, app) { + super(); this._app = app; this._button = button; @@ -89,44 +83,41 @@ const ApplicationMenuItem = new Lang.Class({ draggable.connect('drag-end', () => { Shell.util_set_hidden_from_pick(Main.legacyTray.actor, false); }); - }, + } activate(event) { this._app.open_new_window(-1); this._button.selectCategory(null, null); this._button.menu.toggle(); - this.parent(event); - }, + super.activate(event); + } setActive(active, params) { if (active) this._button.scrollToButton(this); - this.parent(active, params); - }, + super.setActive(active, params); + } setDragEnabled(enable) { this._dragEnabled = enable; - }, + } getDragActor() { return this._app.create_icon_texture(APPLICATION_ICON_SIZE); - }, + } getDragActorSource() { return this._iconBin; - }, + } _updateIcon() { this._iconBin.set_child(this.getDragActor()); } -}); +}; -const CategoryMenuItem = new Lang.Class({ - Name: 'CategoryMenuItem', - Extends: PopupMenu.PopupBaseMenuItem, - - _init(button, category) { - this.parent(); +class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem { + constructor(button, category) { + super(); this._category = category; this._button = button; @@ -141,13 +132,13 @@ const CategoryMenuItem = new Lang.Class({ this.actor.add_child(new St.Label({ text: name })); this.actor.connect('motion-event', Lang.bind(this, this._onMotionEvent)); - }, + } activate(event) { this._button.selectCategory(this._category, this); this._button.scrollToCatButton(this); - this.parent(event); - }, + super.activate(event); + } _isNavigatingSubmenu([x, y]) { let [posX, posY] = this.actor.get_transformed_position(); @@ -204,7 +195,7 @@ const CategoryMenuItem = new Lang.Class({ return true; return false; - }, + } _onMotionEvent(actor, event) { if (!Clutter.get_pointer_grab()) { @@ -227,44 +218,41 @@ const CategoryMenuItem = new Lang.Class({ source.sync_hover(); return false; - }, + } setActive(active, params) { if (active) { this._button.selectCategory(this._category, this); this._button.scrollToCatButton(this); } - this.parent(active, params); + super.setActive(active, params); } -}); +}; -const ApplicationsMenu = new Lang.Class({ - Name: 'ApplicationsMenu', - Extends: PopupMenu.PopupMenu, - - _init(sourceActor, arrowAlignment, arrowSide, button) { - this.parent(sourceActor, arrowAlignment, arrowSide); +class ApplicationsMenu extends PopupMenu.PopupMenu { + constructor(sourceActor, arrowAlignment, arrowSide, button) { + super(sourceActor, arrowAlignment, arrowSide); this._button = button; - }, + } isEmpty() { return false; - }, + } open(animate) { this._button.hotCorner.setBarrierSize(0); if (this._button.hotCorner.actor) // fallback corner this._button.hotCorner.actor.hide(); - this.parent(animate); - }, + super.open(animate); + } close(animate) { let size = Main.layoutManager.panelBox.height; this._button.hotCorner.setBarrierSize(size); if (this._button.hotCorner.actor) // fallback corner this._button.hotCorner.actor.show(); - this.parent(animate); - }, + super.close(animate); + } toggle() { if (this.isOpen) { @@ -273,14 +261,12 @@ const ApplicationsMenu = new Lang.Class({ if (Main.overview.visible) Main.overview.hide(); } - this.parent(); + super.toggle(); } -}); +}; -const DesktopTarget = new Lang.Class({ - Name: 'DesktopTarget', - - _init() { +class DesktopTarget { + constructor() { this._desktop = null; this._desktopDestroyedId = 0; @@ -291,11 +277,11 @@ const DesktopTarget = new Lang.Class({ global.get_window_actors().forEach(a => { this._onWindowAdded(a.get_parent(), a); }); - }, + } get hasDesktop() { return this._desktop != null; - }, + } _onWindowAdded(group, actor) { if (!(actor instanceof Meta.WindowActor)) @@ -303,7 +289,7 @@ const DesktopTarget = new Lang.Class({ if (actor.meta_window.get_window_type() == Meta.WindowType.DESKTOP) this._setDesktop(actor); - }, + } _setDesktop(desktop) { if (this._desktop) { @@ -322,13 +308,13 @@ const DesktopTarget = new Lang.Class({ }); this._desktop._delegate = this; } - }, + } _getSourceAppInfo(source) { if (!(source instanceof ApplicationMenuItem)) return null; return source._app.app_info; - }, + } _touchFile(file) { let queryFlags = Gio.FileQueryInfoFlags.NONE; @@ -345,7 +331,7 @@ const DesktopTarget = new Lang.Class({ log('Failed to update access time: ' + e.message); } }); - }, + } _markTrusted(file) { let modeAttr = Gio.FILE_ATTRIBUTE_UNIX_MODE; @@ -372,7 +358,7 @@ const DesktopTarget = new Lang.Class({ log('Failed to mark file as trusted: ' + e.message); } }); - }, + } destroy() { if (this._windowAddedId) @@ -380,7 +366,7 @@ const DesktopTarget = new Lang.Class({ this._windowAddedId = 0; this._setDesktop(null); - }, + } handleDragOver(source, actor, x, y, time) { let appInfo = this._getSourceAppInfo(source); @@ -388,7 +374,7 @@ const DesktopTarget = new Lang.Class({ return DND.DragMotionResult.CONTINUE; return DND.DragMotionResult.COPY_DROP; - }, + } acceptDrop(source, actor, x, y, time) { let appInfo = this._getSourceAppInfo(source); @@ -412,15 +398,12 @@ const DesktopTarget = new Lang.Class({ return true; } -}); +}; Signals.addSignalMethods(DesktopTarget.prototype); -const ApplicationsButton = new Lang.Class({ - Name: 'ApplicationsButton', - Extends: PanelMenu.Button, - - _init() { - this.parent(1.0, null, false); +class ApplicationsButton extends PanelMenu.Button { + constructor() { + super(1.0, null, false); this.setMenu(new ApplicationsMenu(this.actor, 1.0, St.Side.TOP, this)); Main.panel.menuManager.addMenu(this.menu); @@ -475,7 +458,7 @@ const ApplicationsButton = new Lang.Class({ this._display(); this._installedChangedId = appSys.connect('installed-changed', Lang.bind(this, this._onTreeChanged)); - }, + } _onTreeChanged() { if (this.menu.isOpen) { @@ -484,18 +467,18 @@ const ApplicationsButton = new Lang.Class({ } else { this.reloadFlag = true; } - }, + } get hotCorner() { return Main.layoutManager.hotCorners[Main.layoutManager.primaryIndex]; - }, + } _createVertSeparator() { let separator = new St.DrawingArea({ style_class: 'calendar-vertical-separator', pseudo_class: 'highlighted' }); separator.connect('repaint', Lang.bind(this, this._onVertSepRepaint)); return separator; - }, + } _onDestroy() { Main.overview.disconnect(this._showingId); @@ -512,7 +495,7 @@ const ApplicationsButton = new Lang.Class({ null); this._desktopTarget.destroy(); - }, + } _onCapturedEvent(actor, event) { if (event.type() == Clutter.EventType.BUTTON_PRESS) { @@ -520,7 +503,7 @@ const ApplicationsButton = new Lang.Class({ return true; } return false; - }, + } _onMenuKeyPress(actor, event) { let symbol = event.get_key_symbol(); @@ -530,8 +513,8 @@ const ApplicationsButton = new Lang.Class({ if (this.menu.actor.navigate_focus(global.stage.key_focus, direction, false)) return true; } - return this.parent(actor, event); - }, + return super._onMenuKeyPress(actor, event); + } _onVertSepRepaint(area) { let cr = area.get_context(); @@ -546,7 +529,7 @@ const ApplicationsButton = new Lang.Class({ cr.setDash([1, 3], 1); // Hard-code for now cr.setLineWidth(stippleWidth); cr.stroke(); - }, + } _onOpenStateChanged(menu, open) { if (open) { @@ -556,21 +539,21 @@ const ApplicationsButton = new Lang.Class({ } this.mainBox.show(); } - this.parent(menu, open); - }, + super._onOpenStateChanged(menu, open); + } _setKeybinding() { Main.wm.setCustomKeybindingHandler('panel-main-menu', Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, () => { this.menu.toggle(); }); - }, + } _redisplay() { this.applicationsBox.destroy_all_children(); this.categoriesBox.destroy_all_children(); this._display(); - }, + } _loadCategory(categoryId, dir) { let iter = dir.iter(); @@ -597,7 +580,7 @@ const ApplicationsButton = new Lang.Class({ this._loadCategory(categoryId, subdir); } } - }, + } scrollToButton(button) { let appsScrollBoxAdj = this.applicationsScrollBox.get_vscroll_bar().get_adjustment(); @@ -612,7 +595,7 @@ const ApplicationsButton = new Lang.Class({ newScrollValue = buttonAlloc.y2 - boxHeight + 10; if (newScrollValue != currentScrollValue) appsScrollBoxAdj.set_value(newScrollValue); - }, + } scrollToCatButton(button) { let catsScrollBoxAdj = this.categoriesScrollBox.get_vscroll_bar().get_adjustment(); @@ -627,7 +610,7 @@ const ApplicationsButton = new Lang.Class({ newScrollValue = buttonAlloc.y2 - boxHeight + 10; if (newScrollValue != currentScrollValue) catsScrollBoxAdj.set_value(newScrollValue); - }, + } _createLayout() { let section = new PopupMenu.PopupMenuSection(); @@ -670,7 +653,7 @@ const ApplicationsButton = new Lang.Class({ this.mainBox.add(this._createVertSeparator(), { expand: false, x_fill: false, y_fill: true}); this.mainBox.add(this.applicationsScrollBox, { expand: true, x_fill: true, y_fill: true }); section.actor.add_actor(this.mainBox); - }, + } _display() { this._applicationsButtons.clear(); @@ -705,7 +688,7 @@ const ApplicationsButton = new Lang.Class({ let height = this.categoriesBox.height + MENU_HEIGHT_OFFSET + 'px'; this.mainBox.style+=('height: ' + height); - }, + } selectCategory(dir, categoryMenuItem) { this.applicationsBox.get_children().forEach(c => { @@ -719,7 +702,7 @@ const ApplicationsButton = new Lang.Class({ this._displayButtons(this._listApplications(dir.get_menu_id())); else this._displayButtons(this._listApplications(null)); - }, + } _displayButtons(apps) { if (apps) { @@ -739,7 +722,7 @@ const ApplicationsButton = new Lang.Class({ this.applicationsBox.add_actor(item.actor); } } - }, + } _listApplications(category_menu_id) { let applist; @@ -757,13 +740,13 @@ const ApplicationsButton = new Lang.Class({ } return applist; - }, + } destroy() { this.menu.actor.get_children().forEach(c => { c.destroy() }); - this.parent(); + super.destroy(); } -}); +}; let appsMenuButton; let activitiesButton; diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index 19be3520..34da4503 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -19,31 +19,29 @@ const SETTINGS_KEY = 'application-list'; let settings; -const WindowMover = new Lang.Class({ - Name: 'AutoMoveWindows.WindowMover', - - _init() { +class WindowMover { + constructor() { this._settings = settings; this._windowTracker = Shell.WindowTracker.get_default(); let display = global.screen.get_display(); // Connect after so the handler from ShellWindowTracker has already run this._windowCreatedId = display.connect_after('window-created', Lang.bind(this, this._findAndMove)); - }, + } destroy() { if (this._windowCreatedId) { global.screen.get_display().disconnect(this._windowCreatedId); this._windowCreatedId = 0; } - }, + } _ensureAtLeastWorkspaces(num, window) { for (let j = global.screen.n_workspaces; j <= num; j++) { window.change_workspace_by_index(j-1, false); global.screen.append_new_workspace(false, 0); } - }, + } _findAndMove(display, window, noRecurse) { if (window.skip_taskbar) @@ -77,7 +75,7 @@ const WindowMover = new Lang.Class({ } } } -}); +}; let prevCheckWorkspaces; let winMover; diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index 12af2362..9356b59a 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -18,12 +18,9 @@ const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); const Convenience = Me.imports.convenience; -const MountMenuItem = new Lang.Class({ - Name: 'DriveMenu.MountMenuItem', - Extends: PopupMenu.PopupBaseMenuItem, - - _init(mount) { - this.parent(); +class MountMenuItem extends PopupMenu.PopupBaseMenuItem { + constructor(mount) { + super(); this.label = new St.Label({ text: mount.get_name() }); this.actor.add(this.label, { expand: true }); @@ -39,7 +36,7 @@ const MountMenuItem = new Lang.Class({ this._changedId = mount.connect('changed', Lang.bind(this, this._syncVisibility)); this._syncVisibility(); - }, + } destroy() { if (this._changedId) { @@ -47,8 +44,8 @@ const MountMenuItem = new Lang.Class({ this._changedId = 0; } - this.parent(); - }, + super.destroy(); + } _isInteresting() { if (!this.mount.can_eject() && !this.mount.can_unmount()) @@ -65,11 +62,11 @@ const MountMenuItem = new Lang.Class({ } return volume.get_identifier('class') != 'network'; - }, + } _syncVisibility() { this.actor.visible = this._isInteresting(); - }, + } _eject() { let mountOp = new ShellMountOperation.ShellMountOperation(this.mount); @@ -84,7 +81,7 @@ const MountMenuItem = new Lang.Class({ mountOp.mountOp, null, // Gio.Cancellable Lang.bind(this, this._unmountFinish)); - }, + } _unmountFinish(mount, result) { try { @@ -92,7 +89,7 @@ const MountMenuItem = new Lang.Class({ } catch(e) { this._reportFailure(e); } - }, + } _ejectFinish(mount, result) { try { @@ -100,29 +97,26 @@ const MountMenuItem = new Lang.Class({ } catch(e) { this._reportFailure(e); } - }, + } _reportFailure(exception) { // TRANSLATORS: %s is the filesystem name let msg = _("Ejecting drive “%s” failed:").format(this.mount.get_name()); Main.notifyError(msg, exception.message); - }, + } activate(event) { let context = global.create_app_launch_context(event.get_time(), -1); Gio.AppInfo.launch_default_for_uri(this.mount.get_root().get_uri(), context); - this.parent(event); + super.activate(event); } -}); +}; -const DriveMenu = new Lang.Class({ - Name: 'DriveMenu.DriveMenu', - Extends: PanelMenu.Button, - - _init() { - this.parent(0.0, _("Removable devices")); +class DriveMenu extends PanelMenu.Button { + constructor() { + super(0.0, _("Removable devices")); let hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' }); let icon = new St.Icon({ icon_name: 'media-eject-symbolic', @@ -154,20 +148,20 @@ const DriveMenu = new Lang.Class({ }); this._updateMenuVisibility(); - }, + } _updateMenuVisibility() { if (this._mounts.filter(i => i.actor.visible).length > 0) this.actor.show(); else this.actor.hide(); - }, + } _addMount(mount) { let item = new MountMenuItem(mount); this._mounts.unshift(item); this.menu.addMenuItem(item, 0); - }, + } _removeMount(mount) { for (let i = 0; i < this._mounts.length; i++) { @@ -179,7 +173,7 @@ const DriveMenu = new Lang.Class({ } } log ('Removing a mount that was never added to the menu'); - }, + } destroy() { if (this._connectedId) { @@ -189,9 +183,9 @@ const DriveMenu = new Lang.Class({ this._disconnectedId = 0; } - this.parent(); - }, -}); + super.destroy(); + } +}; function init() { Convenience.initTranslations(); diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index 8a479cc8..bf0a4827 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -1,6 +1,4 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- -const Lang = imports.lang; - const Workspace = imports.ui.workspace; const ExtensionUtils = imports.misc.extensionUtils; @@ -14,19 +12,17 @@ const WINDOW_PLACEMENT_NATURAL_ACCURACY = 20; // accuracy const WINDOW_PLACEMENT_NATURAL_GAPS = 5; // half of the minimum gap between windows const WINDOW_PLACEMENT_NATURAL_MAX_TRANSLATIONS = 5000; // safety limit for preventing endless loop if something is wrong in the algorithm -const Rect = new Lang.Class({ - Name: 'NativeWindowPlacement.Rect', - - _init(x, y, width, height) { +class Rect { + constructor(x, y, width, height) { [this.x, this.y, this.width, this.height] = [x, y, width, height]; - }, + } /** * used in _calculateWindowTransformationsNatural to replace Meta.Rectangle that is too slow. */ copy() { return new Rect(this.x, this.y, this.width, this.height); - }, + } union(rect2) { let dest = this.copy(); @@ -46,7 +42,7 @@ const Rect = new Lang.Class({ dest.height = rect2.y + rect2.height - dest.y; return dest; - }, + } adjusted(dx, dy, dx2, dy2) { let dest = this.copy(); @@ -55,36 +51,34 @@ const Rect = new Lang.Class({ dest.width += -dx + dx2; dest.height += -dy + dy2; return dest; - }, + } overlap(rect2) { return !((this.x + this.width <= rect2.x) || (rect2.x + rect2.width <= this.x) || (this.y + this.height <= rect2.y) || (rect2.y + rect2.height <= this.y)); - }, + } center() { return [this.x + this.width / 2, this.y + this.height / 2]; - }, + } translate(dx, dy) { this.x += dx; this.y += dy; } -}); +}; -const NaturalLayoutStrategy = new Lang.Class({ - Name: 'NaturalLayoutStrategy', - Extends: Workspace.LayoutStrategy, - - _init(settings) { +class NaturalLayoutStrategy extends Workspace.LayoutStrategy { + constructor(settings) { + super(); this._settings = settings; - }, + } computeLayout(windows, layout) { layout.windows = windows; - }, + } /** * Returns clones with matching target coordinates and scales to arrange windows in a natural way that no overlap exists and relative window size is preserved. @@ -246,7 +240,7 @@ const NaturalLayoutStrategy = new Lang.Class({ return slots; } -}); +}; let winInjections, workspaceInjections; diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index 0a8bd5e3..45cc9460 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -23,12 +23,9 @@ const PlaceDisplay = Me.imports.placeDisplay; const PLACE_ICON_SIZE = 16; -const PlaceMenuItem = new Lang.Class({ - Name: 'PlaceMenuItem', - Extends: PopupMenu.PopupBaseMenuItem, - - _init(info) { - this.parent(); +class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem { + constructor(info) { + super(); this._info = info; this._icon = new St.Icon({ gicon: info.icon, @@ -48,7 +45,7 @@ const PlaceMenuItem = new Lang.Class({ this._changedId = info.connect('changed', Lang.bind(this, this._propertiesChanged)); - }, + } destroy() { if (this._changedId) { @@ -56,20 +53,20 @@ const PlaceMenuItem = new Lang.Class({ this._changedId = 0; } - this.parent(); - }, + super.destroy(); + } activate(event) { this._info.launch(event.get_time()); - this.parent(event); - }, + super.activate(event); + } _propertiesChanged(info) { this._icon.gicon = info.icon; this._label.text = info.name; - }, -}); + } +}; const SECTIONS = [ 'special', @@ -78,12 +75,9 @@ const SECTIONS = [ 'network' ] -const PlacesMenu = new Lang.Class({ - Name: 'PlacesMenu.PlacesMenu', - Extends: PanelMenu.Button, - - _init() { - this.parent(0.0, _("Places")); +class PlacesMenu extends PanelMenu.Button { + constructor() { + super(0.0, _("Places")); let hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' }); let label = new St.Label({ text: _("Places"), @@ -108,18 +102,18 @@ const PlacesMenu = new Lang.Class({ this.menu.addMenuItem(this._sections[id]); this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); } - }, + } destroy() { this.placesManager.destroy(); - this.parent(); - }, + super.destroy(); + } _redisplay(id) { this._sections[id].removeAll(); this._create(id); - }, + } _create(id) { let places = this.placesManager.get(id); @@ -129,7 +123,7 @@ const PlacesMenu = new Lang.Class({ this._sections[id].actor.visible = places.length > 0; } -}); +}; function init() { Convenience.initTranslations(); diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index 46ec011e..b1be6572 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -28,22 +28,24 @@ const Hostname1Iface = ' \ '; const Hostname1 = Gio.DBusProxy.makeProxyWrapper(Hostname1Iface); -const PlaceInfo = new Lang.Class({ - Name: 'PlaceInfo', +class PlaceInfo { + constructor() { + this._init.apply(this, arguments); + } _init(kind, file, name, icon) { this.kind = kind; this.file = file; this.name = name || this._getFileName(); this.icon = icon ? new Gio.ThemedIcon({ name: icon }) : this.getIcon(); - }, + } destroy() { - }, + } isRemovable() { return false; - }, + } _createLaunchCallback(launchContext, tryMount) { return (_ignored, result) => { @@ -78,7 +80,7 @@ const PlaceInfo = new Lang.Class({ Main.notifyError(_("Failed to launch “%s”").format(this.name), e.message); } } - }, + } launch(timestamp) { let launchContext = global.create_app_launch_context(timestamp, -1); @@ -87,7 +89,7 @@ const PlaceInfo = new Lang.Class({ launchContext, null, callback); - }, + } getIcon() { this.file.query_info_async('standard::symbolic-icon', 0, 0, null, @@ -116,7 +118,7 @@ const PlaceInfo = new Lang.Class({ else return new Gio.ThemedIcon({ name: 'folder-symbolic' }); } - }, + } _getFileName() { try { @@ -125,16 +127,13 @@ const PlaceInfo = new Lang.Class({ } catch(e if e instanceof Gio.IOErrorEnum) { return this.file.get_basename(); } - }, -}); + } +}; Signals.addSignalMethods(PlaceInfo.prototype); -const RootInfo = new Lang.Class({ - Name: 'RootInfo', - Extends: PlaceInfo, - +class RootInfo extends PlaceInfo { _init() { - this.parent('devices', Gio.File.new_for_path('/'), _("Computer")); + super._init('devices', Gio.File.new_for_path('/'), _("Computer")); this._proxy = new Hostname1(Gio.DBus.system, 'org.freedesktop.hostname1', @@ -147,11 +146,11 @@ const RootInfo = new Lang.Class({ Lang.bind(this, this._propertiesChanged)); this._propertiesChanged(obj); }); - }, + } getIcon() { return new Gio.ThemedIcon({ name: 'drive-harddisk-symbolic' }); - }, + } _propertiesChanged(proxy) { // GDBusProxy will emit a g-properties-changed when hostname1 goes down @@ -160,31 +159,28 @@ const RootInfo = new Lang.Class({ this.name = proxy.PrettyHostname || _("Computer"); this.emit('changed'); } - }, + } destroy() { this._proxy.run_dispose(); - this.parent(); + super.destroy(); } -}); +}; -const PlaceDeviceInfo = new Lang.Class({ - Name: 'PlaceDeviceInfo', - Extends: PlaceInfo, - +class PlaceDeviceInfo extends PlaceInfo { _init(kind, mount) { this._mount = mount; - this.parent(kind, mount.get_root(), mount.get_name()); - }, + super._init(kind, mount.get_root(), mount.get_name()); + } getIcon() { return this._mount.get_symbolic_icon(); - }, + } isRemovable() { return this._mount.can_eject(); - }, + } eject() { let mountOp = new ShellMountOperation.ShellMountOperation(this._mount); @@ -199,7 +195,7 @@ const PlaceDeviceInfo = new Lang.Class({ mountOp.mountOp, null, // Gio.Cancellable Lang.bind(this, this._unmountFinish)); - }, + } _ejectFinish(mount, result) { try { @@ -207,7 +203,7 @@ const PlaceDeviceInfo = new Lang.Class({ } catch(e) { this._reportFailure(e); } - }, + } _unmountFinish(mount, result) { try { @@ -215,26 +211,23 @@ const PlaceDeviceInfo = new Lang.Class({ } catch(e) { this._reportFailure(e); } - }, + } _reportFailure(exception) { let msg = _("Ejecting drive “%s” failed:").format(this._mount.get_name()); Main.notifyError(msg, exception.message); } -}); - -const PlaceVolumeInfo = new Lang.Class({ - Name: 'PlaceVolumeInfo', - Extends: PlaceInfo, +}; +class PlaceVolumeInfo extends PlaceInfo { _init(kind, volume) { this._volume = volume; - this.parent(kind, volume.get_activation_root(), volume.get_name()); - }, + super._init(kind, volume.get_activation_root(), volume.get_name()); + } launch(timestamp) { if (this.file) { - this.parent(timestamp); + super.launch(timestamp); return; } @@ -243,14 +236,14 @@ const PlaceVolumeInfo = new Lang.Class({ let mount = volume.get_mount(); this.file = mount.get_root(); - this.parent(timestamp); + super.launch(timestamp); }); - }, + } getIcon() { return this._volume.get_symbolic_icon(); } -}); +}; const DEFAULT_DIRECTORIES = [ GLib.UserDirectory.DIRECTORY_DOCUMENTS, @@ -260,10 +253,8 @@ const DEFAULT_DIRECTORIES = [ GLib.UserDirectory.DIRECTORY_VIDEOS, ]; -var PlacesManager = new Lang.Class({ - Name: 'PlacesManager', - - _init() { +var PlacesManager = class { + constructor() { this._places = { special: [], devices: [], @@ -303,7 +294,7 @@ var PlacesManager = new Lang.Class({ this._reloadBookmarks(); } - }, + } _connectVolumeMonitorSignals() { const signals = ['volume-added', 'volume-removed', 'volume-changed', @@ -316,7 +307,7 @@ var PlacesManager = new Lang.Class({ let id = this._volumeMonitor.connect(signals[i], func); this._volumeMonitorSignals.push(id); } - }, + } destroy() { if (this._settings) @@ -330,7 +321,7 @@ var PlacesManager = new Lang.Class({ this._monitor.cancel(); if (this._bookmarkTimeoutId) Mainloop.source_remove(this._bookmarkTimeoutId); - }, + } _updateSpecials() { this._places.special.forEach(p => { p.destroy(); }); @@ -367,7 +358,7 @@ var PlacesManager = new Lang.Class({ this._places.special = this._places.special.concat(specials); this.emit('special-updated'); - }, + } _updateMounts() { let networkMounts = []; @@ -450,7 +441,7 @@ var PlacesManager = new Lang.Class({ this.emit('devices-updated'); this.emit('network-updated'); - }, + } _findBookmarksFile() { let paths = [ @@ -464,7 +455,7 @@ var PlacesManager = new Lang.Class({ } return null; - }, + } _reloadBookmarks() { @@ -514,7 +505,7 @@ var PlacesManager = new Lang.Class({ this._places.bookmarks = bookmarks; this.emit('bookmarks-updated'); - }, + } _addMount(kind, mount) { let devItem; @@ -526,7 +517,7 @@ var PlacesManager = new Lang.Class({ } this._places[kind].push(devItem); - }, + } _addVolume(kind, volume) { let volItem; @@ -538,10 +529,10 @@ var PlacesManager = new Lang.Class({ } this._places[kind].push(volItem); - }, + } get(kind) { return this._places[kind]; } -}); +}; Signals.addSignalMethods(PlacesManager.prototype); diff --git a/extensions/user-theme/extension.js b/extensions/user-theme/extension.js index 13dc4570..0c792cfc 100644 --- a/extensions/user-theme/extension.js +++ b/extensions/user-theme/extension.js @@ -12,17 +12,15 @@ const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); const Convenience = Me.imports.convenience; -const ThemeManager = new Lang.Class({ - Name: 'UserTheme.ThemeManager', - - _init() { +class ThemeManager { + constructor() { this._settings = Convenience.getSettings(); - }, + } enable() { this._changedId = this._settings.connect('changed::'+SETTINGS_KEY, Lang.bind(this, this._changeTheme)); this._changeTheme(); - }, + } disable() { if (this._changedId) { @@ -32,7 +30,7 @@ const ThemeManager = new Lang.Class({ Main.setThemeStylesheet(null); Main.loadTheme(); - }, + } _changeTheme() { let _stylesheet = null; @@ -64,7 +62,7 @@ const ThemeManager = new Lang.Class({ Main.setThemeStylesheet(_stylesheet); Main.loadTheme(); } -}); +}; function init() { return new ThemeManager(); diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 5a5ce952..6d09525e 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -64,12 +64,9 @@ function _getAppStableSequence(app) { } -const WindowContextMenu = new Lang.Class({ - Name: 'WindowContextMenu', - Extends: PopupMenu.PopupMenu, - - _init(source, metaWindow) { - this.parent(source, 0.5, St.Side.BOTTOM); +class WindowContextMenu extends PopupMenu.PopupMenu { + constructor(source, metaWindow) { + super(source, 0.5, St.Side.BOTTOM); this._metaWindow = metaWindow; @@ -123,31 +120,29 @@ const WindowContextMenu = new Lang.Class({ this._maximizeItem.setSensitive(this._metaWindow.can_maximize()); this._closeItem.setSensitive(this._metaWindow.can_close()); }); - }, + } _updateMinimizeItem() { this._minimizeItem.label.text = this._metaWindow.minimized ? _("Unminimize") : _("Minimize"); - }, + } _updateMaximizeItem() { let maximized = this._metaWindow.maximized_vertically && this._metaWindow.maximized_horizontally; this._maximizeItem.label.text = maximized ? _("Unmaximize") : _("Maximize"); - }, + } _onDestroy() { this._metaWindow.disconnect(this._notifyMinimizedId); this._metaWindow.disconnect(this._notifyMaximizedHId); this._metaWindow.disconnect(this._notifyMaximizedVId); } -}); +}; -const WindowTitle = new Lang.Class({ - Name: 'WindowTitle', - - _init(metaWindow) { +class WindowTitle { + constructor(metaWindow) { this._metaWindow = metaWindow; this.actor = new St.BoxLayout({ style_class: 'window-button-box', x_expand: true, y_expand: true }); @@ -178,12 +173,12 @@ const WindowTitle = new Lang.Class({ this._metaWindow.connect('notify::minimized', Lang.bind(this, this._minimizedChanged)); this._minimizedChanged(); - }, + } _minimizedChanged() { this._icon.opacity = this._metaWindow.minimized ? 128 : 255; this._updateTitle(); - }, + } _updateTitle() { if (!this._metaWindow.title) @@ -193,7 +188,7 @@ const WindowTitle = new Lang.Class({ this.label_actor.text = '[%s]'.format(this._metaWindow.title); else this.label_actor.text = this._metaWindow.title; - }, + } _updateIcon() { let app = Shell.WindowTracker.get_default().get_window_app(this._metaWindow); @@ -202,7 +197,7 @@ const WindowTitle = new Lang.Class({ else this._icon.child = new St.Icon({ icon_name: 'icon-missing', icon_size: ICON_TEXTURE_SIZE }); - }, + } _onDestroy() { this._textureCache.disconnect(this._iconThemeChangedId); @@ -211,14 +206,14 @@ const WindowTitle = new Lang.Class({ this._metaWindow.disconnect(this._notifyWmClass); this._metaWindow.disconnect(this._notifyAppId); } -}); +}; -const BaseButton = new Lang.Class({ - Name: 'BaseButton', - Abstract: true, +class BaseButton { + constructor(perMonitor, monitorIndex) { + if (this.constructor === BaseButton) + throw new TypeError('Cannot instantiate abstract class BaseButton'); - _init(perMonitor, monitorIndex) { this._perMonitor = perMonitor; this._monitorIndex = monitorIndex; @@ -250,47 +245,47 @@ const BaseButton = new Lang.Class({ global.screen.connect('window-left-monitor', Lang.bind(this, this._windowEnteredOrLeftMonitor)); } - }, + } get active() { return this.actor.has_style_class_name('focused'); - }, + } activate() { if (this.active) return; this._onClicked(this.actor, 1); - }, + } _onClicked(actor, button) { throw new Error('Not implemented'); - }, + } _canOpenPopupMenu() { return true; - }, + } _onPopupMenu(actor) { if (!this._canOpenPopupMenu() || this._contextMenu.isOpen) return; _openMenu(this._contextMenu); - }, + } _isFocused() { throw new Error('Not implemented'); - }, + } _updateStyle() { if (this._isFocused()) this.actor.add_style_class_name('focused'); else this.actor.remove_style_class_name('focused'); - }, + } _windowEnteredOrLeftMonitor(metaScreen, monitorIndex, metaWindow) { throw new Error('Not implemented'); - }, + } _isWindowVisible(window) { let workspace = global.screen.get_active_workspace(); @@ -298,11 +293,11 @@ const BaseButton = new Lang.Class({ return !window.skip_taskbar && window.located_on_workspace(workspace) && (!this._perMonitor || window.get_monitor() == this._monitorIndex); - }, + } _updateVisibility() { throw new Error('Not implemented'); - }, + } _getIconGeometry() { let rect = new Meta.Rectangle(); @@ -311,11 +306,11 @@ const BaseButton = new Lang.Class({ [rect.width, rect.height] = this.actor.get_transformed_size(); return rect; - }, + } _updateIconGeometry() { throw new Error('Not implemented'); - }, + } _onDestroy() { global.window_manager.disconnect(this._switchWorkspaceId); @@ -328,15 +323,12 @@ const BaseButton = new Lang.Class({ global.screen.disconnect(this._windowLeftMonitorId); this._windowLeftMonitorId = 0; } -}); +}; -const WindowButton = new Lang.Class({ - Name: 'WindowButton', - Extends: BaseButton, - - _init(metaWindow, perMonitor, monitorIndex) { - this.parent(perMonitor, monitorIndex); +class WindowButton extends BaseButton { + constructor(metaWindow, perMonitor, monitorIndex) { + super(perMonitor, monitorIndex); this.metaWindow = metaWindow; this._updateVisibility(); @@ -359,7 +351,7 @@ const WindowButton = new Lang.Class({ global.display.connect('notify::focus-window', Lang.bind(this, this._updateStyle)); this._updateStyle(); - }, + } _onClicked(actor, button) { if (this._contextMenu.isOpen) { @@ -371,49 +363,46 @@ const WindowButton = new Lang.Class({ _minimizeOrActivateWindow(this.metaWindow); else _openMenu(this._contextMenu); - }, + } _isFocused() { return global.display.focus_window == this.metaWindow; - }, + } _updateStyle() { - this.parent(); + super._updateStyle(); if (this.metaWindow.minimized) this.actor.add_style_class_name('minimized'); else this.actor.remove_style_class_name('minimized'); - }, + } _windowEnteredOrLeftMonitor(metaScreen, monitorIndex, metaWindow) { if (monitorIndex == this._monitorIndex && metaWindow == this.metaWindow) this._updateVisibility(); - }, + } _updateVisibility() { this.actor.visible = this._isWindowVisible(this.metaWindow); - }, + } _updateIconGeometry() { this.metaWindow.set_icon_geometry(this._getIconGeometry()); - }, + } _onDestroy() { - this.parent(); + super._onDestroy(); this.metaWindow.disconnect(this._workspaceChangedId); global.display.disconnect(this._notifyFocusId); this._contextMenu.destroy(); } -}); +}; -const AppContextMenu = new Lang.Class({ - Name: 'AppContextMenu', - Extends: PopupMenu.PopupMenu, - - _init(source, appButton) { - this.parent(source, 0.5, St.Side.BOTTOM); +class AppContextMenu extends PopupMenu.PopupMenu { + constructor(source, appButton) { + super(source, 0.5, St.Side.BOTTOM); this._appButton = appButton; @@ -454,7 +443,7 @@ const AppContextMenu = new Lang.Class({ }); }); this.addMenuItem(item); - }, + } open(animate) { let windows = this._appButton.getWindowList(); @@ -467,16 +456,13 @@ const AppContextMenu = new Lang.Class({ return w.maximized_horizontally && w.maximized_vertically; }); - this.parent(animate); + super.open(animate); } -}); +}; -const AppButton = new Lang.Class({ - Name: 'AppButton', - Extends: BaseButton, - - _init(app, perMonitor, monitorIndex) { - this.parent(perMonitor, monitorIndex); +class AppButton extends BaseButton { + constructor(app, perMonitor, monitorIndex) { + super(perMonitor, monitorIndex); this.app = app; this._updateVisibility(); @@ -531,7 +517,7 @@ const AppButton = new Lang.Class({ this._windowTracker.connect('notify::focus-app', Lang.bind(this, this._updateStyle)); this._updateStyle(); - }, + } _windowEnteredOrLeftMonitor(metaScreen, monitorIndex, metaWindow) { if (this._windowTracker.get_window_app(metaWindow) == this.app && @@ -539,7 +525,7 @@ const AppButton = new Lang.Class({ this._updateVisibility(); this._windowsChanged(); } - }, + } _updateVisibility() { if (!this._perMonitor) { @@ -549,22 +535,22 @@ const AppButton = new Lang.Class({ } else { this.actor.visible = this.getWindowList().length >= 1; } - }, + } _isFocused() { return this._windowTracker.focus_app == this.app; - }, + } _updateIconGeometry() { let rect = this._getIconGeometry(); let windows = this.app.get_windows(); windows.forEach(w => { w.set_icon_geometry(rect); }); - }, + } getWindowList() { return this.app.get_windows().filter(win => this._isWindowVisible(win)); - }, + } _windowsChanged() { let windows = this.getWindowList(); @@ -599,7 +585,7 @@ const AppButton = new Lang.Class({ this.actor.label_actor = this._multiWindowTitle.label_actor; } - }, + } _onClicked(actor, button) { let menuWasOpen = this._menu.isOpen; @@ -636,32 +622,29 @@ const AppButton = new Lang.Class({ return; _openMenu(this._contextMenu); } - }, + } _canOpenPopupMenu() { return !this._menu.isOpen; - }, + } _onMenuActivate(menu, child) { child._window.activate(global.get_current_time()); - }, + } _onDestroy() { - this.parent(); + super._onDestroy(); this._textureCache.disconnect(this._iconThemeChangedId); this._windowTracker.disconnect(this._notifyFocusId); this.app.disconnect(this._windowsChangedId); this._menu.destroy(); } -}); +}; -const WorkspaceIndicator = new Lang.Class({ - Name: 'WindowList.WorkspaceIndicator', - Extends: PanelMenu.Button, - - _init() { - this.parent(0.0, _("Workspace Indicator"), true); +class WorkspaceIndicator extends PanelMenu.Button { + constructor() { + super(0.0, _("Workspace Indicator"), true); this.setMenu(new PopupMenu.PopupMenu(this.actor, 0.0, St.Side.BOTTOM)); this.actor.add_style_class_name('window-list-workspace-indicator'); this.menu.actor.remove_style_class_name('panel-menu'); @@ -687,7 +670,7 @@ const WorkspaceIndicator = new Lang.Class({ this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.preferences' }); this._settingsChangedId = this._settings.connect('changed::workspace-names', Lang.bind(this, this._updateMenu)); - }, + } destroy() { for (let i = 0; i < this._screenSignals.length; i++) @@ -698,8 +681,8 @@ const WorkspaceIndicator = new Lang.Class({ this._settingsChangedId = 0; } - this.parent(); - }, + super.destroy(); + } _updateIndicator() { this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.NONE); @@ -707,14 +690,14 @@ const WorkspaceIndicator = new Lang.Class({ this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.DOT); this.statusLabel.set_text(this._getStatusText()); - }, + } _getStatusText() { let current = global.screen.get_active_workspace().index(); let total = global.screen.n_workspaces; return '%d / %d'.format(current + 1, total); - }, + } _updateMenu() { this.menu.removeAll(); @@ -738,14 +721,14 @@ const WorkspaceIndicator = new Lang.Class({ } this.statusLabel.set_text(this._getStatusText()); - }, + } _activate(index) { if(index >= 0 && index < global.screen.n_workspaces) { let metaWorkspace = global.screen.get_workspace_by_index(index); metaWorkspace.activate(global.get_current_time()); } - }, + } _onScrollEvent(actor, event) { let direction = event.get_scroll_direction(); @@ -760,18 +743,16 @@ const WorkspaceIndicator = new Lang.Class({ let newIndex = this._currentWorkspace + diff; this._activate(newIndex); - }, + } _allocate(actor, box, flags) { if (actor.get_n_children() > 0) actor.get_first_child().allocate(box, flags); } -}); +}; -const WindowList = new Lang.Class({ - Name: 'WindowList', - - _init(perMonitor, monitor) { +class WindowList { + constructor(perMonitor, monitor) { this._perMonitor = perMonitor; this._monitor = monitor; @@ -895,20 +876,20 @@ const WindowList = new Lang.Class({ Lang.bind(this, this._groupingModeChanged)); this._grouped = undefined; this._groupingModeChanged(); - }, + } _getDynamicWorkspacesSettings() { if (this._workspaceSettings.list_keys().indexOf('dynamic-workspaces') > -1) return this._workspaceSettings; return this._mutterSettings; - }, + } _getWorkspaceSettings() { let settings = global.get_overrides_settings(); if (settings.list_keys().indexOf('workspaces-only-on-primary') > -1) return settings; return this._mutterSettings; - }, + } _onScrollEvent(actor, event) { let direction = event.get_scroll_direction(); @@ -931,12 +912,12 @@ const WindowList = new Lang.Class({ active = Math.max(0, Math.min(active + diff, children.length-1)); children[active].activate(); - }, + } _updatePosition() { this.actor.set_position(this._monitor.x, this._monitor.y + this._monitor.height - this.actor.height); - }, + } _updateWorkspaceIndicatorVisibility() { let hasWorkspaces = this._dynamicWorkspacesSettings.get_boolean('dynamic-workspaces') || @@ -945,7 +926,7 @@ const WindowList = new Lang.Class({ !this._workspaceSettings.get_boolean('workspaces-only-on-primary'); this._workspaceIndicator.actor.visible = hasWorkspaces && workspacesOnMonitor; - }, + } _getPreferredUngroupedWindowListWidth() { if (this._windowList.get_n_children() == 0) @@ -964,12 +945,12 @@ const WindowList = new Lang.Class({ return this._windowList.get_preferred_width(-1)[1]; return nWindows * childWidth + (nWindows - 1) * spacing; - }, + } _getMaxWindowListWidth() { let indicatorsBox = this._workspaceIndicator.actor.get_parent(); return this.actor.width - indicatorsBox.get_preferred_width(-1)[1]; - }, + } _groupingModeChanged() { this._groupingMode = this._settings.get_enum('grouping-mode'); @@ -980,7 +961,7 @@ const WindowList = new Lang.Class({ this._grouped = this._groupingMode == GroupingMode.ALWAYS; this._populateWindowList(); } - }, + } _checkGrouping() { if (this._groupingMode != GroupingMode.AUTO) @@ -994,7 +975,7 @@ const WindowList = new Lang.Class({ this._grouped = grouped; this._populateWindowList(); } - }, + } _populateWindowList() { this._windowList.destroy_all_children(); @@ -1014,7 +995,7 @@ const WindowList = new Lang.Class({ for (let i = 0; i < apps.length; i++) this._addApp(apps[i]); } - }, + } _updateKeyboardAnchor() { if (!Main.keyboard.actor) @@ -1022,7 +1003,7 @@ const WindowList = new Lang.Class({ let anchorY = Main.overview.visible ? 0 : this.actor.height; Main.keyboard.actor.anchor_y = anchorY; - }, + } _onAppStateChanged(appSys, app) { if (!this._grouped) @@ -1032,7 +1013,7 @@ const WindowList = new Lang.Class({ this._addApp(app); else if (app.state == Shell.AppState.STOPPED) this._removeApp(app); - }, + } _addApp(app) { let button = new AppButton(app, this._perMonitor, this._monitor.index); @@ -1040,7 +1021,7 @@ const WindowList = new Lang.Class({ true, true, true, Clutter.BoxAlignment.START, Clutter.BoxAlignment.START); - }, + } _removeApp(app) { let children = this._windowList.get_children(); @@ -1050,7 +1031,7 @@ const WindowList = new Lang.Class({ return; } } - }, + } _onWindowAdded(ws, win) { if (win.skip_taskbar) @@ -1073,7 +1054,7 @@ const WindowList = new Lang.Class({ true, true, true, Clutter.BoxAlignment.START, Clutter.BoxAlignment.START); - }, + } _onWindowRemoved(ws, win) { if (this._grouped) @@ -1092,7 +1073,7 @@ const WindowList = new Lang.Class({ return; } } - }, + } _onWorkspacesChanged() { let numWorkspaces = global.screen.n_workspaces; @@ -1112,7 +1093,7 @@ const WindowList = new Lang.Class({ } this._updateWorkspaceIndicatorVisibility(); - }, + } _disconnectWorkspaceSignals() { let numWorkspaces = global.screen.n_workspaces; @@ -1123,16 +1104,16 @@ const WindowList = new Lang.Class({ workspace.disconnect(signals._windowAddedId); workspace.disconnect(signals._windowRemovedId); } - }, + } _onDragBegin() { DND.addDragMonitor(this._dragMonitor); - }, + } _onDragEnd() { DND.removeDragMonitor(this._dragMonitor); this._removeActivateTimeout(); - }, + } _onDragMotion(dragEvent) { if (Main.overview.visible || @@ -1157,14 +1138,14 @@ const WindowList = new Lang.Class({ Lang.bind(this, this._activateWindow)); return DND.DragMotionResult.CONTINUE; - }, + } _removeActivateTimeout() { if (this._dndTimeoutId) GLib.source_remove (this._dndTimeoutId); this._dndTimeoutId = 0; this._dndWindow = null; - }, + } _activateWindow() { let [x, y] = global.get_pointer(); @@ -1176,7 +1157,7 @@ const WindowList = new Lang.Class({ this._dndTimeoutId = 0; return false; - }, + } _onDestroy() { this._workspaceSettings.disconnect(this._workspacesOnlyOnPrimaryChangedId); @@ -1216,15 +1197,13 @@ const WindowList = new Lang.Class({ for (let i = 0; i < windows.length; i++) windows[i].metaWindow.set_icon_geometry(null); } -}); +}; -const Extension = new Lang.Class({ - Name: 'Extension', - - _init() { +class Extension { + constructor() { this._windowLists = null; this._injections = {}; - }, + } enable() { this._windowLists = []; @@ -1239,7 +1218,7 @@ const Extension = new Lang.Class({ Lang.bind(this, this._buildWindowLists)); this._buildWindowLists(); - }, + } _buildWindowLists() { this._windowLists.forEach(list => { list.actor.destroy(); }); @@ -1251,7 +1230,7 @@ const Extension = new Lang.Class({ if (showOnAllMonitors || monitor == Main.layoutManager.primaryMonitor) this._windowLists.push(new WindowList(showOnAllMonitors, monitor)); }); - }, + } disable() { if (!this._windowLists) @@ -1268,12 +1247,12 @@ const Extension = new Lang.Class({ windowList.actor.destroy(); }); this._windowLists = null; - }, + } someWindowListContains(actor) { return this._windowLists.some(list => list.actor.contains(actor)); } -}); +}; function init() { return new Extension(); diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index eb4cfe13..5aa8b122 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -22,12 +22,9 @@ const Convenience = Me.imports.convenience; const WORKSPACE_SCHEMA = 'org.gnome.desktop.wm.preferences'; const WORKSPACE_KEY = 'workspace-names'; -const WorkspaceIndicator = new Lang.Class({ - Name: 'WorkspaceIndicator.WorkspaceIndicator', - Extends: PanelMenu.Button, - - _init() { - this.parent(0.0, _("Workspace Indicator")); +class WorkspaceIndicator extends PanelMenu.Button { + constructor() { + super(0.0, _("Workspace Indicator")); this._currentWorkspace = global.screen.get_active_workspace().index(); this.statusLabel = new St.Label({ y_align: Clutter.ActorAlign.CENTER, @@ -52,7 +49,7 @@ const WorkspaceIndicator = new Lang.Class({ this._settings = new Gio.Settings({ schema_id: WORKSPACE_SCHEMA }); this._settingsChangedId = this._settings.connect('changed::' + WORKSPACE_KEY, Lang.bind(this, this._createWorkspacesSection)); - }, + } destroy() { for (let i = 0; i < this._screenSignals.length; i++) @@ -63,8 +60,8 @@ const WorkspaceIndicator = new Lang.Class({ this._settingsChangedId = 0; } - this.parent(); - }, + super.destroy(); + } _updateIndicator() { this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.NONE); @@ -72,7 +69,7 @@ const WorkspaceIndicator = new Lang.Class({ this.workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.DOT); this.statusLabel.set_text(this._labelText()); - }, + } _labelText(workspaceIndex) { if(workspaceIndex == undefined) { @@ -80,7 +77,7 @@ const WorkspaceIndicator = new Lang.Class({ return (workspaceIndex + 1).toString(); } return Meta.prefs_get_workspace_name(workspaceIndex); - }, + } _createWorkspacesSection() { this._workspaceSection.removeAll(); @@ -103,14 +100,14 @@ const WorkspaceIndicator = new Lang.Class({ } this.statusLabel.set_text(this._labelText()); - }, + } _activate(index) { if(index >= 0 && index < global.screen.n_workspaces) { let metaWorkspace = global.screen.get_workspace_by_index(index); metaWorkspace.activate(global.get_current_time()); } - }, + } _onScrollEvent(actor, event) { let direction = event.get_scroll_direction(); @@ -125,8 +122,8 @@ const WorkspaceIndicator = new Lang.Class({ let newIndex = global.screen.get_active_workspace().index() + diff; this._activate(newIndex); - }, -}); + } +}; function init(meta) { Convenience.initTranslations(); From acb44de4690bfebf058a20cdda70b22d567f2f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 28 Oct 2017 01:05:11 +0200 Subject: [PATCH 33/60] cleanup: Port GObject classes to ES6 classes GJS added API for defining GObject classes with ES6 class syntax last cycle, use it to port the remaining Lang.Class classes to the new syntax. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30 --- extensions/alternate-tab/prefs.js | 11 +++---- extensions/auto-move-windows/prefs.js | 24 +++++++------- extensions/example/prefs.js | 9 ++---- extensions/window-list/prefs.js | 9 ++---- extensions/workspace-indicator/prefs.js | 42 +++++++++++-------------- 5 files changed, 39 insertions(+), 56 deletions(-) diff --git a/extensions/alternate-tab/prefs.js b/extensions/alternate-tab/prefs.js index dda78ee7..3b9149ef 100644 --- a/extensions/alternate-tab/prefs.js +++ b/extensions/alternate-tab/prefs.js @@ -21,13 +21,10 @@ const MODES = { 'both': N_("Thumbnail and application icon"), }; -const AltTabSettingsWidget = new GObject.Class({ - Name: 'AlternateTab.Prefs.AltTabSettingsWidget', - GTypeName: 'AltTabSettingsWidget', - Extends: Gtk.Grid, - +const AltTabSettingsWidget = GObject.registerClass( +class AltTabSettingsWidget extends Gtk.Grid { _init(params) { - this.parent(params); + super._init(params); this.margin = 24; this.row_spacing = 6; this.orientation = Gtk.Orientation.VERTICAL; @@ -69,7 +66,7 @@ const AltTabSettingsWidget = new GObject.Class({ margin_top: 6 }); this._settings.bind(SETTINGS_CURRENT_WORKSPACE_ONLY, check, 'active', Gio.SettingsBindFlags.DEFAULT); this.add(check); - }, + } }); function init() { diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index 52e25fd9..16c0416a 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -26,13 +26,11 @@ const Columns = { ADJUSTMENT: 4 }; -const Widget = new GObject.Class({ - Name: 'AutoMoveWindows.Prefs.Widget', +const Widget = GObject.registerClass({ GTypeName: 'AutoMoveWindowsPrefsWidget', - Extends: Gtk.Grid, - +}, class Widget extends Gtk.Grid { _init(params) { - this.parent(params); + super._init(params); this.set_orientation(Gtk.Orientation.VERTICAL); this._settings = Convenience.getSettings(); @@ -95,7 +93,7 @@ const Widget = new GObject.Class({ this._changedPermitted = true; this._refresh(); - }, + } _createNew() { let dialog = new Gtk.Dialog({ title: _("Create new matching rule"), @@ -158,7 +156,7 @@ const Widget = new GObject.Class({ dialog.destroy(); }); dialog.show_all(); - }, + } _deleteSelected() { let [any, model, iter] = this._treeView.get_selection().get_selected(); @@ -171,7 +169,7 @@ const Widget = new GObject.Class({ this._changedPermitted = true; this._store.remove(iter); } - }, + } _workspaceEdited(renderer, pathString, text) { let index = parseInt(text); @@ -185,7 +183,7 @@ const Widget = new GObject.Class({ this._changeItem(appInfo.get_id(), index); this._store.set_value(iter, Columns.WORKSPACE, index); this._changedPermitted = true; - }, + } _refresh() { if (!this._changedPermitted) @@ -215,18 +213,18 @@ const Widget = new GObject.Class({ if (validItems.length != currentItems.length) // some items were filtered out this._settings.set_strv(SETTINGS_KEY, validItems); - }, + } _checkId(id) { let items = this._settings.get_strv(SETTINGS_KEY); return !items.some(i => i.startsWith(id + ':')); - }, + } _appendItem(id, workspace) { let currentItems = this._settings.get_strv(SETTINGS_KEY); currentItems.push(id + ':' + workspace); this._settings.set_strv(SETTINGS_KEY, currentItems); - }, + } _removeItem(id) { let currentItems = this._settings.get_strv(SETTINGS_KEY); @@ -236,7 +234,7 @@ const Widget = new GObject.Class({ return; currentItems.splice(index, 1); this._settings.set_strv(SETTINGS_KEY, currentItems); - }, + } _changeItem(id, workspace) { let currentItems = this._settings.get_strv(SETTINGS_KEY); diff --git a/extensions/example/prefs.js b/extensions/example/prefs.js index 40ff041d..c5023fd9 100644 --- a/extensions/example/prefs.js +++ b/extensions/example/prefs.js @@ -16,13 +16,10 @@ function init() { Convenience.initTranslations(); } -const ExamplePrefsWidget = new GObject.Class({ - Name: 'Example.Prefs.Widget', - GTypeName: 'ExamplePrefsWidget', - Extends: Gtk.Grid, - +const ExamplePrefsWidget = GObject.registerClass( +class ExamplePrefsWidget extends Gtk.Grid { _init(params) { - this.parent(params); + super._init(params); this.margin = 12; this.row_spacing = this.column_spacing = 6; this.set_orientation(Gtk.Orientation.VERTICAL); diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js index c5e13ee7..bc1abcdf 100644 --- a/extensions/window-list/prefs.js +++ b/extensions/window-list/prefs.js @@ -16,13 +16,10 @@ function init() { Convenience.initTranslations(); } -const WindowListPrefsWidget = new GObject.Class({ - Name: 'WindowList.Prefs.Widget', - GTypeName: 'WindowListPrefsWidget', - Extends: Gtk.Grid, - +const WindowListPrefsWidget = GObject.registerClass( +class WindowListPrefsWidget extends Gtk.Grid { _init(params) { - this.parent(params); + super._init(params); this.margin = 24; this.row_spacing = 6; diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index 3dbde708..cfb6d8cb 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -17,19 +17,16 @@ const Convenience = Me.imports.convenience; const WORKSPACE_SCHEMA = 'org.gnome.desktop.wm.preferences'; const WORKSPACE_KEY = 'workspace-names'; -const WorkspaceNameModel = new GObject.Class({ - Name: 'WorkspaceIndicator.WorkspaceNameModel', - GTypeName: 'WorkspaceNameModel', - Extends: Gtk.ListStore, - - Columns: { - LABEL: 0, - }, - +const WorkspaceNameModel = GObject.registerClass( +class WorkspaceNameModel extends Gtk.ListStore { _init(params) { - this.parent(params); + super._init(params); this.set_column_types([GObject.TYPE_STRING]); + this.Columns = { + LABEL: 0, + }; + this._settings = new Gio.Settings({ schema_id: WORKSPACE_SCHEMA }); //this._settings.connect('changed::workspace-names', Lang.bind(this, this._reloadFromSettings)); @@ -40,7 +37,7 @@ const WorkspaceNameModel = new GObject.Class({ this.connect('row-changed', Lang.bind(this, this._onRowChanged)); this.connect('row-inserted', Lang.bind(this, this._onRowInserted)); this.connect('row-deleted', Lang.bind(this, this._onRowDeleted)); - }, + } _reloadFromSettings() { if (this._preventChanges) @@ -67,7 +64,7 @@ const WorkspaceNameModel = new GObject.Class({ } this._preventChanges = false; - }, + } _onRowChanged(self, path, iter) { if (this._preventChanges) @@ -88,7 +85,7 @@ const WorkspaceNameModel = new GObject.Class({ this._settings.set_strv(WORKSPACE_KEY, names); this._preventChanges = false; - }, + } _onRowInserted(self, path, iter) { if (this._preventChanges) @@ -103,7 +100,7 @@ const WorkspaceNameModel = new GObject.Class({ this._settings.set_strv(WORKSPACE_KEY, names); this._preventChanges = false; - }, + } _onRowDeleted(self, path) { if (this._preventChanges) @@ -125,16 +122,13 @@ const WorkspaceNameModel = new GObject.Class({ this._settings.set_strv(WORKSPACE_KEY, names); this._preventChanges = false; - }, + } }); -const WorkspaceSettingsWidget = new GObject.Class({ - Name: 'WorkspaceIndicator.WorkspaceSettingsWidget', - GTypeName: 'WorkspaceSettingsWidget', - Extends: Gtk.Grid, - +const WorkspaceSettingsWidget = GObject.registerClass( +class WorkspaceSettingsWidget extends Gtk.Grid { _init(params) { - this.parent(params); + super._init(params); this.margin = 12; this.orientation = Gtk.Orientation.VERTICAL; @@ -181,14 +175,14 @@ const WorkspaceSettingsWidget = new GObject.Class({ delButton.sensitive = selection.count_selected_rows() > 0; this.add(toolbar); - }, + } _cellEdited(renderer, path, new_text) { let [ok, iter] = this._store.get_iter_from_string(path); if (ok) this._store.set(iter, [this._store.Columns.LABEL], [new_text]); - }, + } _newClicked() { let iter = this._store.append(); @@ -196,7 +190,7 @@ const WorkspaceSettingsWidget = new GObject.Class({ let label = _("Workspace %d").format(index + 1); this._store.set(iter, [this._store.Columns.LABEL], [label]); - }, + } _delClicked() { let [any, model, iter] = this._treeView.get_selection().get_selected(); From ba27cc4a64daf7f62174653362741de30c2f5b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 13 Nov 2017 17:13:01 +0000 Subject: [PATCH 34/60] cleanup: Get rid of Lang.bind() After replacing Lang.Class with ES6 classes and adopting arrow notation for anonymous callbacks, we only use the Lang module to bind `this` to named callbacks. However since ES5, this functionality is already provided by Function.prototype.bind() - in fact, Lang.bind() itself uses it when no extra arguments are specified. So just use the built-in function directly instead of the wrapper. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30 --- extensions/alternate-tab/extension.js | 13 +-- extensions/apps-menu/extension.js | 21 +++-- extensions/auto-move-windows/extension.js | 3 +- extensions/auto-move-windows/prefs.js | 9 +- extensions/drive-menu/extension.js | 11 ++- extensions/places-menu/extension.js | 5 +- extensions/places-menu/placeDisplay.js | 11 ++- extensions/user-theme/extension.js | 3 +- extensions/window-list/extension.js | 91 +++++++++++---------- extensions/windowsNavigator/extension.js | 7 +- extensions/workspace-indicator/extension.js | 15 ++-- extensions/workspace-indicator/prefs.js | 15 ++-- 12 files changed, 103 insertions(+), 101 deletions(-) diff --git a/extensions/alternate-tab/extension.js b/extensions/alternate-tab/extension.js index 88e36390..58f212a1 100644 --- a/extensions/alternate-tab/extension.js +++ b/extensions/alternate-tab/extension.js @@ -1,7 +1,6 @@ /* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */ const Clutter = imports.gi.Clutter; -const Lang = imports.lang; const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; @@ -43,15 +42,19 @@ function enable() { tabPopup.destroy(); }; - setKeybinding('switch-applications', Lang.bind(Main.wm, Main.wm._forcedWindowSwitcher)); - setKeybinding('switch-applications-backward', Lang.bind(Main.wm, Main.wm._forcedWindowSwitcher)); + setKeybinding('switch-applications', + Main.wm._forcedWindowSwitcher.bind(Main.wm)); + setKeybinding('switch-applications-backward', + Main.wm._forcedWindowSwitcher.bind(Main.wm)); } function disable() { var prop; - setKeybinding('switch-applications', Lang.bind(Main.wm, Main.wm._startSwitcher)); - setKeybinding('switch-applications-backward', Lang.bind(Main.wm, Main.wm._startSwitcher)); + setKeybinding('switch-applications', + Main.wm._startSwitcher.bind(Main.wm)); + setKeybinding('switch-applications-backward', + Main.wm._startSwitcher.bind(Main.wm)); for (prop in injections) AltTab.WindowSwitcherPopup.prototype[prop] = injections[prop]; diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index d5d8af7a..5b382138 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -3,7 +3,6 @@ const Atk = imports.gi.Atk; const DND = imports.ui.dnd; const GMenu = imports.gi.GMenu; -const Lang = imports.lang; const Shell = imports.gi.Shell; const St = imports.gi.St; const Clutter = imports.gi.Clutter; @@ -61,7 +60,7 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem { let textureCache = St.TextureCache.get_default(); let iconThemeChangedId = textureCache.connect('icon-theme-changed', - Lang.bind(this, this._updateIcon)); + this._updateIcon.bind(this)); this.actor.connect('destroy', () => { textureCache.disconnect(iconThemeChangedId); }); @@ -131,7 +130,7 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem { name = _("Favorites"); this.actor.add_child(new St.Label({ text: name })); - this.actor.connect('motion-event', Lang.bind(this, this._onMotionEvent)); + this.actor.connect('motion-event', this._onMotionEvent.bind(this)); } activate(event) { @@ -272,7 +271,7 @@ class DesktopTarget { this._windowAddedId = global.window_group.connect('actor-added', - Lang.bind(this, this._onWindowAdded)); + this._onWindowAdded.bind(this)); global.get_window_actors().forEach(a => { this._onWindowAdded(a.get_parent(), a); @@ -425,8 +424,8 @@ class ApplicationsButton extends PanelMenu.Button { this.actor.name = 'panelApplications'; this.actor.label_actor = this._label; - this.actor.connect('captured-event', Lang.bind(this, this._onCapturedEvent)); - this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); + this.actor.connect('captured-event', this._onCapturedEvent.bind(this)); + this.actor.connect('destroy', this._onDestroy.bind(this)); this._showingId = Main.overview.connect('showing', () => { this.actor.add_accessible_state (Atk.StateType.CHECKED); @@ -435,7 +434,7 @@ class ApplicationsButton extends PanelMenu.Button { this.actor.remove_accessible_state (Atk.StateType.CHECKED); }); Main.layoutManager.connect('startup-complete', - Lang.bind(this, this._setKeybinding)); + this._setKeybinding.bind(this)); this._setKeybinding(); this._desktopTarget = new DesktopTarget(); @@ -450,14 +449,14 @@ class ApplicationsButton extends PanelMenu.Button { this._tree = new GMenu.Tree({ menu_basename: 'applications.menu' }); this._treeChangedId = this._tree.connect('changed', - Lang.bind(this, this._onTreeChanged)); + this._onTreeChanged.bind(this)); this._applicationsButtons = new Map(); this.reloadFlag = false; this._createLayout(); this._display(); this._installedChangedId = appSys.connect('installed-changed', - Lang.bind(this, this._onTreeChanged)); + this._onTreeChanged.bind(this)); } _onTreeChanged() { @@ -476,7 +475,7 @@ class ApplicationsButton extends PanelMenu.Button { _createVertSeparator() { let separator = new St.DrawingArea({ style_class: 'calendar-vertical-separator', pseudo_class: 'highlighted' }); - separator.connect('repaint', Lang.bind(this, this._onVertSepRepaint)); + separator.connect('repaint', this._onVertSepRepaint.bind(this)); return separator; } @@ -491,7 +490,7 @@ class ApplicationsButton extends PanelMenu.Button { Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, Main.sessionMode.hasOverview ? - Lang.bind(Main.overview, Main.overview.toggle) : + Main.overview.toggle.bind(Main.overview) : null); this._desktopTarget.destroy(); diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index 34da4503..ca9cd905 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -3,7 +3,6 @@ const Glib = imports.gi.GLib; const Gio = imports.gi.Gio; -const Lang = imports.lang; const Mainloop = imports.mainloop; const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; @@ -26,7 +25,7 @@ class WindowMover { let display = global.screen.get_display(); // Connect after so the handler from ShellWindowTracker has already run - this._windowCreatedId = display.connect_after('window-created', Lang.bind(this, this._findAndMove)); + this._windowCreatedId = display.connect_after('window-created', this._findAndMove.bind(this)); } destroy() { diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index 16c0416a..f163a19f 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -4,7 +4,6 @@ const Gio = imports.gi.Gio; const GObject = imports.gi.GObject; const Gtk = imports.gi.Gtk; -const Lang = imports.lang; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; @@ -34,7 +33,7 @@ const Widget = GObject.registerClass({ this.set_orientation(Gtk.Orientation.VERTICAL); this._settings = Convenience.getSettings(); - this._settings.connect('changed', Lang.bind(this, this._refresh)); + this._settings.connect('changed', this._refresh.bind(this)); this._changedPermitted = false; this._store = new Gtk.ListStore(); @@ -63,7 +62,7 @@ const Widget = GObject.registerClass({ let workspaceColumn = new Gtk.TreeViewColumn({ title: _("Workspace"), sort_column_id: Columns.WORKSPACE }); let workspaceRenderer = new Gtk.CellRendererSpin({ editable: true }); - workspaceRenderer.connect('edited', Lang.bind(this, this._workspaceEdited)); + workspaceRenderer.connect('edited', this._workspaceEdited.bind(this)); workspaceColumn.pack_start(workspaceRenderer, true); workspaceColumn.add_attribute(workspaceRenderer, "adjustment", Columns.ADJUSTMENT); workspaceColumn.add_attribute(workspaceRenderer, "text", Columns.WORKSPACE); @@ -78,11 +77,11 @@ const Widget = GObject.registerClass({ let newButton = new Gtk.ToolButton({ icon_name: 'bookmark-new-symbolic', label: _("Add Rule"), is_important: true }); - newButton.connect('clicked', Lang.bind(this, this._createNew)); + newButton.connect('clicked', this._createNew.bind(this)); toolbar.add(newButton); let delButton = new Gtk.ToolButton({ icon_name: 'edit-delete-symbolic' }); - delButton.connect('clicked', Lang.bind(this, this._deleteSelected)); + delButton.connect('clicked', this._deleteSelected.bind(this)); toolbar.add(delButton); let selection = this._treeView.get_selection(); diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index 9356b59a..3c3dbe8c 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -1,7 +1,6 @@ // Drive menu extension const Clutter = imports.gi.Clutter; const Gio = imports.gi.Gio; -const Lang = imports.lang; const St = imports.gi.St; const Shell = imports.gi.Shell; @@ -31,10 +30,10 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem { let ejectIcon = new St.Icon({ icon_name: 'media-eject-symbolic', style_class: 'popup-menu-icon ' }); let ejectButton = new St.Button({ child: ejectIcon }); - ejectButton.connect('clicked', Lang.bind(this, this._eject)); + ejectButton.connect('clicked', this._eject.bind(this)); this.actor.add(ejectButton); - this._changedId = mount.connect('changed', Lang.bind(this, this._syncVisibility)); + this._changedId = mount.connect('changed', this._syncVisibility.bind(this)); this._syncVisibility(); } @@ -75,12 +74,12 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem { this.mount.eject_with_operation(Gio.MountUnmountFlags.NONE, mountOp.mountOp, null, // Gio.Cancellable - Lang.bind(this, this._ejectFinish)); + this._ejectFinish.bind(this)); else this.mount.unmount_with_operation(Gio.MountUnmountFlags.NONE, mountOp.mountOp, null, // Gio.Cancellable - Lang.bind(this, this._unmountFinish)); + this._unmountFinish.bind(this)); } _unmountFinish(mount, result) { @@ -138,7 +137,7 @@ class DriveMenu extends PanelMenu.Button { this._mounts = [ ]; - this._monitor.get_mounts().forEach(Lang.bind(this, this._addMount)); + this._monitor.get_mounts().forEach(this._addMount.bind(this)); this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); this.menu.addAction(_("Open Files"), event => { diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index 45cc9460..429e81dc 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -3,7 +3,6 @@ const Clutter = imports.gi.Clutter; const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; -const Lang = imports.lang; const Shell = imports.gi.Shell; const St = imports.gi.St; @@ -39,12 +38,12 @@ class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem { this._ejectIcon = new St.Icon({ icon_name: 'media-eject-symbolic', style_class: 'popup-menu-icon ' }); this._ejectButton = new St.Button({ child: this._ejectIcon }); - this._ejectButton.connect('clicked', Lang.bind(info, info.eject)); + this._ejectButton.connect('clicked', info.eject.bind(info)); this.actor.add_child(this._ejectButton); } this._changedId = info.connect('changed', - Lang.bind(this, this._propertiesChanged)); + this._propertiesChanged.bind(this)); } destroy() { diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index b1be6572..9885d0a8 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -3,7 +3,6 @@ const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; const Shell = imports.gi.Shell; -const Lang = imports.lang; const Mainloop = imports.mainloop; const Signals = imports.signals; const St = imports.gi.St; @@ -143,7 +142,7 @@ class RootInfo extends PlaceInfo { return; this._proxy.connect('g-properties-changed', - Lang.bind(this, this._propertiesChanged)); + this._propertiesChanged.bind(this)); this._propertiesChanged(obj); }); } @@ -189,12 +188,12 @@ class PlaceDeviceInfo extends PlaceInfo { this._mount.eject_with_operation(Gio.MountUnmountFlags.NONE, mountOp.mountOp, null, // Gio.Cancellable - Lang.bind(this, this._ejectFinish)); + this._ejectFinish.bind(this)); else this._mount.unmount_with_operation(Gio.MountUnmountFlags.NONE, mountOp.mountOp, null, // Gio.Cancellable - Lang.bind(this, this._unmountFinish)); + this._unmountFinish.bind(this)); } _ejectFinish(mount, result) { @@ -265,7 +264,7 @@ var PlacesManager = class { this._settings = new Gio.Settings({ schema_id: BACKGROUND_SCHEMA }); this._showDesktopIconsChangedId = this._settings.connect('changed::show-desktop-icons', - Lang.bind(this, this._updateSpecials)); + this._updateSpecials.bind(this)); this._updateSpecials(); /* @@ -302,7 +301,7 @@ var PlacesManager = class { 'drive-connected', 'drive-disconnected', 'drive-changed']; this._volumeMonitorSignals = []; - let func = Lang.bind(this, this._updateMounts); + let func = this._updateMounts.bind(this); for (let i = 0; i < signals.length; i++) { let id = this._volumeMonitor.connect(signals[i], func); this._volumeMonitorSignals.push(id); diff --git a/extensions/user-theme/extension.js b/extensions/user-theme/extension.js index 0c792cfc..e0c2d57c 100644 --- a/extensions/user-theme/extension.js +++ b/extensions/user-theme/extension.js @@ -3,7 +3,6 @@ const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; -const Lang = imports.lang; const Main = imports.ui.main; const SETTINGS_KEY = 'name'; @@ -18,7 +17,7 @@ class ThemeManager { } enable() { - this._changedId = this._settings.connect('changed::'+SETTINGS_KEY, Lang.bind(this, this._changeTheme)); + this._changedId = this._settings.connect('changed::'+SETTINGS_KEY, this._changeTheme.bind(this)); this._changeTheme(); } diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 6d09525e..4978b497 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -7,7 +7,6 @@ const Shell = imports.gi.Shell; const St = imports.gi.St; const DND = imports.ui.dnd; -const Lang = imports.lang; const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; @@ -81,7 +80,7 @@ class WindowContextMenu extends PopupMenu.PopupMenu { this._notifyMinimizedId = this._metaWindow.connect('notify::minimized', - Lang.bind(this, this._updateMinimizeItem)); + this._updateMinimizeItem.bind(this)); this._updateMinimizeItem(); this._maximizeItem = new PopupMenu.PopupMenuItem(''); @@ -98,10 +97,10 @@ class WindowContextMenu extends PopupMenu.PopupMenu { this._notifyMaximizedHId = this._metaWindow.connect('notify::maximized-horizontally', - Lang.bind(this, this._updateMaximizeItem)); + this._updateMaximizeItem.bind(this)); this._notifyMaximizedVId = this._metaWindow.connect('notify::maximized-vertically', - Lang.bind(this, this._updateMaximizeItem)); + this._updateMaximizeItem.bind(this)); this._updateMaximizeItem(); this._closeItem = new PopupMenu.PopupMenuItem(_("Close")); @@ -110,7 +109,7 @@ class WindowContextMenu extends PopupMenu.PopupMenu { }); this.addMenuItem(this._closeItem); - this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); + this.actor.connect('destroy', this._onDestroy.bind(this)); this.connect('open-state-changed', () => { if (!this.isOpen) @@ -155,23 +154,23 @@ class WindowTitle { this._textureCache = St.TextureCache.get_default(); this._iconThemeChangedId = this._textureCache.connect('icon-theme-changed', - Lang.bind(this, this._updateIcon)); + this._updateIcon.bind(this)); this._notifyWmClass = this._metaWindow.connect('notify::wm-class', - Lang.bind(this, this._updateIcon)); + this._updateIcon.bind(this)); this._notifyAppId = this._metaWindow.connect('notify::gtk-application-id', - Lang.bind(this, this._updateIcon)); + this._updateIcon.bind(this)); this._updateIcon(); - this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); + this.actor.connect('destroy', this._onDestroy.bind(this)); this._notifyTitleId = this._metaWindow.connect('notify::title', - Lang.bind(this, this._updateTitle)); + this._updateTitle.bind(this)); this._notifyMinimizedId = this._metaWindow.connect('notify::minimized', - Lang.bind(this, this._minimizedChanged)); + this._minimizedChanged.bind(this)); this._minimizedChanged(); } @@ -226,24 +225,24 @@ class BaseButton { this.actor._delegate = this; this.actor.connect('allocation-changed', - Lang.bind(this, this._updateIconGeometry)); - this.actor.connect('clicked', Lang.bind(this, this._onClicked)); - this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); - this.actor.connect('popup-menu', Lang.bind(this, this._onPopupMenu)); + this._updateIconGeometry.bind(this)); + this.actor.connect('clicked', this._onClicked.bind(this)); + this.actor.connect('destroy', this._onDestroy.bind(this)); + this.actor.connect('popup-menu', this._onPopupMenu.bind(this)); this._contextMenuManager = new PopupMenu.PopupMenuManager(this); this._switchWorkspaceId = global.window_manager.connect('switch-workspace', - Lang.bind(this, this._updateVisibility)); + this._updateVisibility.bind(this)); if (this._perMonitor) { this._windowEnteredMonitorId = global.screen.connect('window-entered-monitor', - Lang.bind(this, this._windowEnteredOrLeftMonitor)); + this._windowEnteredOrLeftMonitor.bind(this)); this._windowLeftMonitorId = global.screen.connect('window-left-monitor', - Lang.bind(this, this._windowEnteredOrLeftMonitor)); + this._windowEnteredOrLeftMonitor.bind(this)); } } @@ -345,11 +344,11 @@ class WindowButton extends BaseButton { this._workspaceChangedId = this.metaWindow.connect('workspace-changed', - Lang.bind(this, this._updateVisibility)); + this._updateVisibility.bind(this)); this._notifyFocusId = global.display.connect('notify::focus-window', - Lang.bind(this, this._updateStyle)); + this._updateStyle.bind(this)); this._updateStyle(); } @@ -492,7 +491,7 @@ class AppButton extends BaseButton { this._menu = new PopupMenu.PopupMenu(this.actor, 0.5, St.Side.BOTTOM); this._menu.connect('open-state-changed', _onMenuStateChanged); this._menu.actor.hide(); - this._menu.connect('activate', Lang.bind(this, this._onMenuActivate)); + this._menu.connect('activate', this._onMenuActivate.bind(this)); this._menuManager.addMenu(this._menu); Main.uiGroup.add_actor(this._menu.actor); @@ -509,13 +508,13 @@ class AppButton extends BaseButton { this._windowsChangedId = this.app.connect('windows-changed', - Lang.bind(this, this._windowsChanged)); + this._windowsChanged.bind(this)); this._windowsChanged(); this._windowTracker = Shell.WindowTracker.get_default(); this._notifyFocusId = this._windowTracker.connect('notify::focus-app', - Lang.bind(this, this._updateStyle)); + this._updateStyle.bind(this)); this._updateStyle(); } @@ -662,14 +661,18 @@ class WorkspaceIndicator extends PanelMenu.Button { this.workspacesItems = []; this._screenSignals = []; - this._screenSignals.push(global.screen.connect('notify::n-workspaces', Lang.bind(this,this._updateMenu))); - this._screenSignals.push(global.screen.connect_after('workspace-switched', Lang.bind(this,this._updateIndicator))); + this._screenSignals.push(global.screen.connect('notify::n-workspaces', + this._updateMenu.bind(this))); + this._screenSignals.push(global.screen.connect_after('workspace-switched', + this._updateIndicator.bind(this))); - this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); + this.actor.connect('scroll-event', this._onScrollEvent.bind(this)); this._updateMenu(); this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.preferences' }); - this._settingsChangedId = this._settings.connect('changed::workspace-names', Lang.bind(this, this._updateMenu)); + this._settingsChangedId = + this._settings.connect('changed::workspace-names', + this._updateMenu.bind(this)); } destroy() { @@ -761,7 +764,7 @@ class WindowList { reactive: true, track_hover: true, layout_manager: new Clutter.BinLayout()}); - this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); + this.actor.connect('destroy', this._onDestroy.bind(this)); let box = new St.BoxLayout({ x_expand: true, y_expand: true }); this.actor.add_actor(box); @@ -780,7 +783,7 @@ class WindowList { let spacing = node.get_length('spacing'); this._windowList.layout_manager.spacing = spacing; }); - this._windowList.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); + this._windowList.connect('scroll-event', this._onScrollEvent.bind(this)); let indicatorsBox = new St.BoxLayout({ x_align: Clutter.ActorAlign.END }); box.add(indicatorsBox); @@ -792,11 +795,11 @@ class WindowList { this._workspaceSettings = this._getWorkspaceSettings(); this._workspacesOnlyOnPrimaryChangedId = this._workspaceSettings.connect('changed::workspaces-only-on-primary', - Lang.bind(this, this._updateWorkspaceIndicatorVisibility)); + this._updateWorkspaceIndicatorVisibility.bind(this)); this._dynamicWorkspacesSettings = this._getDynamicWorkspacesSettings(); this._dynamicWorkspacesChangedId = this._dynamicWorkspacesSettings.connect('changed::dynamic-workspaces', - Lang.bind(this, this._updateWorkspaceIndicatorVisibility)); + this._updateWorkspaceIndicatorVisibility.bind(this)); this._updateWorkspaceIndicatorVisibility(); this._menuManager = new PopupMenu.PopupMenuManager(this); @@ -808,13 +811,13 @@ class WindowList { Main.ctrlAltTabManager.addGroup(this.actor, _("Window List"), 'start-here-symbolic'); this.actor.width = this._monitor.width; - this.actor.connect('notify::height', Lang.bind(this, this._updatePosition)); + this.actor.connect('notify::height', this._updatePosition.bind(this)); this._updatePosition(); this._appSystem = Shell.AppSystem.get_default(); this._appStateChangedId = this._appSystem.connect('app-state-changed', - Lang.bind(this, this._onAppStateChanged)); + this._onAppStateChanged.bind(this)); this._keyboardVisiblechangedId = Main.layoutManager.connect('keyboard-visible-changed', @@ -833,12 +836,12 @@ class WindowList { this._workspaceSignals = new Map(); this._nWorkspacesChangedId = global.screen.connect('notify::n-workspaces', - Lang.bind(this, this._onWorkspacesChanged)); + this._onWorkspacesChanged.bind(this)); this._onWorkspacesChanged(); this._switchWorkspaceId = global.window_manager.connect('switch-workspace', - Lang.bind(this, this._checkGrouping)); + this._checkGrouping.bind(this)); this._overviewShowingId = Main.overview.connect('showing', () => { @@ -859,12 +862,12 @@ class WindowList { this._dragBeginId = Main.xdndHandler.connect('drag-begin', - Lang.bind(this, this._onDragBegin)); + this._onDragBegin.bind(this)); this._dragEndId = Main.xdndHandler.connect('drag-end', - Lang.bind(this, this._onDragEnd)); + this._onDragEnd.bind(this)); this._dragMonitor = { - dragMotion: Lang.bind(this, this._onDragMotion) + dragMotion: this._onDragMotion.bind(this) }; this._dndTimeoutId = 0; @@ -873,7 +876,7 @@ class WindowList { this._settings = Convenience.getSettings(); this._groupingModeChangedId = this._settings.connect('changed::grouping-mode', - Lang.bind(this, this._groupingModeChanged)); + this._groupingModeChanged.bind(this)); this._grouped = undefined; this._groupingModeChanged(); } @@ -1085,10 +1088,10 @@ class WindowList { let signals = { windowAddedId: 0, windowRemovedId: 0 }; signals._windowAddedId = workspace.connect_after('window-added', - Lang.bind(this, this._onWindowAdded)); + this._onWindowAdded.bind(this)); signals._windowRemovedId = workspace.connect('window-removed', - Lang.bind(this, this._onWindowRemoved)); + this._onWindowRemoved.bind(this)); this._workspaceSignals.set(workspace, signals); } @@ -1135,7 +1138,7 @@ class WindowList { this._dndWindow = hoveredWindow; this._dndTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, DND_ACTIVATE_TIMEOUT, - Lang.bind(this, this._activateWindow)); + this._activateWindow.bind(this)); return DND.DragMotionResult.CONTINUE; } @@ -1211,11 +1214,11 @@ class Extension { this._settings = Convenience.getSettings(); this._showOnAllMonitorsChangedId = this._settings.connect('changed::show-on-all-monitors', - Lang.bind(this, this._buildWindowLists)); + this._buildWindowLists.bind(this)); this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', - Lang.bind(this, this._buildWindowLists)); + this._buildWindowLists.bind(this)); this._buildWindowLists(); } diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js index a2a02575..8c86f0f6 100644 --- a/extensions/windowsNavigator/extension.js +++ b/extensions/windowsNavigator/extension.js @@ -1,6 +1,5 @@ /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ const Clutter = imports.gi.Clutter; -const Lang = imports.lang; const Mainloop = imports.mainloop; const St = imports.gi.St; @@ -244,8 +243,10 @@ function enable() { workViewInjections['_init'] = injectToFunction(WorkspacesView.WorkspacesView.prototype, '_init', function(width, height, x, y, workspaces) { this._pickWorkspace = false; this._pickWindow = false; - this._keyPressEventId = global.stage.connect('key-press-event', Lang.bind(this, this._onKeyPress)); - this._keyReleaseEventId = global.stage.connect('key-release-event', Lang.bind(this, this._onKeyRelease)); + this._keyPressEventId = + global.stage.connect('key-press-event', this._onKeyPress.bind(this)); + this._keyReleaseEventId = + global.stage.connect('key-release-event', this._onKeyRelease.bind(this)); connectedSignals.push({ obj: global.stage, id: this._keyPressEventId }); connectedSignals.push({ obj: global.stage, id: this._keyReleaseEventId }); }); diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index 5aa8b122..ace17039 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -4,7 +4,6 @@ const Gio = imports.gi.Gio; const Meta = imports.gi.Meta; const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const Lang = imports.lang; const Mainloop = imports.mainloop; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; @@ -37,18 +36,22 @@ class WorkspaceIndicator extends PanelMenu.Button { this.menu.addMenuItem(this._workspaceSection); this._screenSignals = []; - this._screenSignals.push(global.screen.connect_after('workspace-added', Lang.bind(this,this._createWorkspacesSection))); - this._screenSignals.push(global.screen.connect_after('workspace-removed', Lang.bind(this,this._createWorkspacesSection))); - this._screenSignals.push(global.screen.connect_after('workspace-switched', Lang.bind(this,this._updateIndicator))); + this._screenSignals.push(global.screen.connect_after('workspace-added', this._createWorkspacesSection.bind(this))); + this._screenSignals.push(global.screen.connect_after('workspace-removed', + this._createWorkspacesSection.bind(this))); + this._screenSignals.push(global.screen.connect_after('workspace-switched', + this._updateIndicator.bind(this))); - this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); + this.actor.connect('scroll-event', this._onScrollEvent.bind(this)); this._createWorkspacesSection(); //styling this.statusLabel.add_style_class_name('panel-workspace-indicator'); this._settings = new Gio.Settings({ schema_id: WORKSPACE_SCHEMA }); - this._settingsChangedId = this._settings.connect('changed::' + WORKSPACE_KEY, Lang.bind(this, this._createWorkspacesSection)); + this._settingsChangedId = + this._settings.connect('changed::' + WORKSPACE_KEY, + this._createWorkspacesSection.bind(this)); } destroy() { diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index cfb6d8cb..71416b3b 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -4,7 +4,6 @@ const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; const Gtk = imports.gi.Gtk; -const Lang = imports.lang; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; @@ -28,15 +27,15 @@ class WorkspaceNameModel extends Gtk.ListStore { }; this._settings = new Gio.Settings({ schema_id: WORKSPACE_SCHEMA }); - //this._settings.connect('changed::workspace-names', Lang.bind(this, this._reloadFromSettings)); + //this._settings.connect('changed::workspace-names', this._reloadFromSettings.bind(this)); this._reloadFromSettings(); // overriding class closure doesn't work, because GtkTreeModel // plays tricks with marshallers and class closures - this.connect('row-changed', Lang.bind(this, this._onRowChanged)); - this.connect('row-inserted', Lang.bind(this, this._onRowInserted)); - this.connect('row-deleted', Lang.bind(this, this._onRowDeleted)); + this.connect('row-changed', this._onRowChanged.bind(this)); + this.connect('row-inserted', this._onRowInserted.bind(this)); + this.connect('row-deleted', this._onRowDeleted.bind(this)); } _reloadFromSettings() { @@ -150,7 +149,7 @@ class WorkspaceSettingsWidget extends Gtk.Grid { let column = new Gtk.TreeViewColumn({ title: _("Name") }); let renderer = new Gtk.CellRendererText({ editable: true }); - renderer.connect('edited', Lang.bind(this, this._cellEdited)); + renderer.connect('edited', this._cellEdited.bind(this)); column.pack_start(renderer, true); column.add_attribute(renderer, 'text', this._store.Columns.LABEL); this._treeView.append_column(column); @@ -161,11 +160,11 @@ class WorkspaceSettingsWidget extends Gtk.Grid { toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR); let newButton = new Gtk.ToolButton({ icon_name: 'list-add-symbolic' }); - newButton.connect('clicked', Lang.bind(this, this._newClicked)); + newButton.connect('clicked', this._newClicked.bind(this)); toolbar.add(newButton); let delButton = new Gtk.ToolButton({ icon_name: 'list-remove-symbolic' }); - delButton.connect('clicked', Lang.bind(this, this._delClicked)); + delButton.connect('clicked', this._delClicked.bind(this)); toolbar.add(delButton); let selection = this._treeView.get_selection(); From 2aaf4370b64822db955532e3e08de625796404d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 1 Dec 2017 21:04:02 +0100 Subject: [PATCH 35/60] meta: Update description note for reporting bugs We no longer take bugs in bugzilla. --- extensions/alternate-tab/metadata.json.in | 2 +- extensions/apps-menu/metadata.json.in | 2 +- extensions/launch-new-instance/metadata.json.in | 2 +- extensions/places-menu/metadata.json.in | 2 +- extensions/window-list/metadata.json.in | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/alternate-tab/metadata.json.in b/extensions/alternate-tab/metadata.json.in index fd647e0b..15663f59 100644 --- a/extensions/alternate-tab/metadata.json.in +++ b/extensions/alternate-tab/metadata.json.in @@ -4,7 +4,7 @@ "settings-schema": "@gschemaname@", "gettext-domain": "@gettext_domain@", "name": "AlternateTab", -"description": "Substitute Alt-Tab with a window based switcher that does not group by application.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME Bugzilla instead.", +"description": "Substitute Alt-Tab with a window based switcher that does not group by application.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME's GitLab instance instead.", "original-authors": [ "jw@bargsten.org", "thomas.bouffon@gmail.com" ], "shell-version": [ "@shell_current@" ], "url": "@url@" diff --git a/extensions/apps-menu/metadata.json.in b/extensions/apps-menu/metadata.json.in index f2c62f0e..f57a47f3 100644 --- a/extensions/apps-menu/metadata.json.in +++ b/extensions/apps-menu/metadata.json.in @@ -3,7 +3,7 @@ "uuid": "@uuid@", "gettext-domain": "@gettext_domain@", "name": "Applications Menu", -"description": "Add a category-based menu for applications.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME Bugzilla instead.", +"description": "Add a category-based menu for applications.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME's GitLab instance instead.", "original-authors": [ "e2002@bk.ru", "debarshir@gnome.org" ], "shell-version": [ "@shell_current@" ], "url": "@url@" diff --git a/extensions/launch-new-instance/metadata.json.in b/extensions/launch-new-instance/metadata.json.in index 2ee7d716..51300cb1 100644 --- a/extensions/launch-new-instance/metadata.json.in +++ b/extensions/launch-new-instance/metadata.json.in @@ -4,7 +4,7 @@ "settings-schema": "@gschemaname@", "gettext-domain": "@gettext_domain@", "name": "Launch new instance", -"description": "Always launch a new instance when clicking in the dash or the application view.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME Bugzilla instead.", +"description": "Always launch a new instance when clicking in the dash or the application view.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME's GitLab instance instead.", "shell-version": [ "@shell_current@" ], "url": "@url@" } diff --git a/extensions/places-menu/metadata.json.in b/extensions/places-menu/metadata.json.in index e8b61acd..cc170dd1 100644 --- a/extensions/places-menu/metadata.json.in +++ b/extensions/places-menu/metadata.json.in @@ -4,7 +4,7 @@ "settings-schema": "@gschemaname@", "gettext-domain": "@gettext_domain@", "name": "Places Status Indicator", -"description": "Add a menu for quickly navigating places in the system.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME Bugzilla instead.", +"description": "Add a menu for quickly navigating places in the system.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME's GitLab instance instead.", "shell-version": [ "@shell_current@" ], "url": "@url@" } diff --git a/extensions/window-list/metadata.json.in b/extensions/window-list/metadata.json.in index 4e98713a..87642e95 100644 --- a/extensions/window-list/metadata.json.in +++ b/extensions/window-list/metadata.json.in @@ -4,7 +4,7 @@ "settings-schema": "@gschemaname@", "gettext-domain": "@gettext_domain@", "name": "Window List", -"description": "Display a window list at the bottom of the screen.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME Bugzilla instead.", +"description": "Display a window list at the bottom of the screen.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME's GitLab instance instead.", "shell-version": [ "@shell_current@" ], "url": "@url@" } From 6a0a247668f4ae9076fadd9559f8c19238141f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= Date: Fri, 15 Dec 2017 13:00:52 +0100 Subject: [PATCH 36/60] build: Use the new array type meson 0.44 features a new option type called `array` that allows more than one string to be passed. This feature fits perfectly the `enable_extensions` option needs, so it has been changed to be an `array` type. the option has not been limited to a set of choices to avoid duplication. --- meson.build | 4 ++-- meson_options.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 92cf3718..c7e04181 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('gnome-shell-extensions', version: '3.27.1', - meson_version: '>= 0.37.0', + meson_version: '>= 0.44.0', license: 'GPL2+' ) @@ -56,7 +56,7 @@ all_extensions += [ 'user-theme' ] -enabled_extensions = get_option('enable_extensions').split() +enabled_extensions = get_option('enable_extensions') if enabled_extensions.length() == 0 set = get_option('extension_set') diff --git a/meson_options.txt b/meson_options.txt index 5a157dfb..8d2eaf8a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,8 +6,8 @@ option('extension_set', ) option('enable_extensions', - type: 'string', - value: '', + type: 'array', + value: [], description: 'Space separated list of extensions to enable instead of a predefined set.' ) From 9dc183af231fd31a02f198c675ae6d81ced2a5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= Date: Wed, 20 Dec 2017 17:41:24 +0100 Subject: [PATCH 37/60] build: Fix description of the `enable_extensions` option The description of the `enable_extensions` was wrong since it changed to the `array` type, because the extension separator is now a comma instead of space. --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 8d2eaf8a..d721a49b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,7 +8,7 @@ option('extension_set', option('enable_extensions', type: 'array', value: [], - description: 'Space separated list of extensions to enable instead of a predefined set.' + description: 'Comma separated list of extensions to enable instead of a predefined set.' ) option('classic_mode', From 22e416c09beb1c61bed7a2c3f9191d3e31d0a8f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 25 Dec 2017 10:21:18 +0100 Subject: [PATCH 38/60] window-list: Fix icons not showing for some windows on wayland On wayland, the properties that are used for application matching are generally set after the window has been created, so it is normal that buttons start with the fallback icon. While we already track the properties that are relevant for app matching, our signal handler may run before the window is matched to its app. Make sure the WindowTracker gets to process those signals first by using connect_after() for our own handlers. Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/10. --- extensions/window-list/extension.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 4978b497..760ba152 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -156,11 +156,11 @@ class WindowTitle { this._textureCache.connect('icon-theme-changed', this._updateIcon.bind(this)); this._notifyWmClass = - this._metaWindow.connect('notify::wm-class', - this._updateIcon.bind(this)); + this._metaWindow.connect_after('notify::wm-class', + this._updateIcon.bind(this)); this._notifyAppId = - this._metaWindow.connect('notify::gtk-application-id', - this._updateIcon.bind(this)); + this._metaWindow.connect_after('notify::gtk-application-id', + this._updateIcon.bind(this)); this._updateIcon(); this.actor.connect('destroy', this._onDestroy.bind(this)); From c668392462a11a0f3707268cb963517cf0b677d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 17 Jan 2018 17:31:51 +0100 Subject: [PATCH 39/60] build: Install schema overrides for classic mode This was lost accidentally when porting to meson. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/45 --- data/meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/meson.build b/data/meson.build index 7cd388d3..43e2aee4 100644 --- a/data/meson.build +++ b/data/meson.build @@ -56,3 +56,6 @@ if sassc.found() endif install_data(theme_data, install_dir: themedir) + +classic_schema = 'org.gnome.shell.extensions.classic-overrides.gschema.xml' +install_data(classic_schema, install_dir: schemadir) From f5c69cbfdc9279d2e01bc7a01594abebf04e344a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 17 Jan 2018 17:32:48 +0100 Subject: [PATCH 40/60] build: Fix generated classic session definition The list of enabled extensions should be an array of strings, so add quotes instead of just dumping the extension names into the file. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/45 --- data/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/meson.build b/data/meson.build index 43e2aee4..1e45638e 100644 --- a/data/meson.build +++ b/data/meson.build @@ -14,7 +14,7 @@ foreach s : sessions endforeach mode_conf = configuration_data() -mode_conf.set('CLASSIC_EXTENSIONS', ','.join(classic_extensions)) +mode_conf.set('CLASSIC_EXTENSIONS', '"' + '", "'.join(classic_extensions) + '"') mode_file = 'classic.json' configure_file( From eba3cfccfe60cae72a6f0011962a167a12b6ffe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 17 Jan 2018 17:57:39 +0100 Subject: [PATCH 41/60] build: Include UUID suffix in classic mode description The shortnames we use elsewhere don't match the actual UUID, so we effectively don't enable any extensions in classic mode at the moment. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/45 --- data/meson.build | 7 ++++++- extensions/meson.build | 2 +- meson.build | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/data/meson.build b/data/meson.build index 1e45638e..c1fbece6 100644 --- a/data/meson.build +++ b/data/meson.build @@ -13,8 +13,13 @@ foreach s : sessions ) endforeach +classic_uuids = [] +foreach e : classic_extensions + classic_uuids += e + uuid_suffix +endforeach + mode_conf = configuration_data() -mode_conf.set('CLASSIC_EXTENSIONS', '"' + '", "'.join(classic_extensions) + '"') +mode_conf.set('CLASSIC_EXTENSIONS', '"' + '", "'.join(classic_uuids) + '"') mode_file = 'classic.json' configure_file( diff --git a/extensions/meson.build b/extensions/meson.build index eba5053c..ed196755 100644 --- a/extensions/meson.build +++ b/extensions/meson.build @@ -4,7 +4,7 @@ js_sources = extensionlib metadata_name = 'metadata.json' foreach e : all_extensions - uuid = e + '@gnome-shell-extensions.gcampax.github.com' + uuid = e + uuid_suffix metadata_conf = configuration_data() metadata_conf.set('extension_id', e) diff --git a/meson.build b/meson.build index c7e04181..23a0cfc0 100644 --- a/meson.build +++ b/meson.build @@ -32,6 +32,8 @@ else shell_version = '.'.join(ver_arr) endif +uuid_suffix = '@gnome-shell-extensions.gcampax.github.com' + classic_extensions = [ 'alternate-tab', 'apps-menu', From 39274f286c164a5daa5ab0cccc13c407c468e9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 17 Jan 2018 21:57:49 +0100 Subject: [PATCH 42/60] places-menu: Minor style tweak Reindent function parameters to fit the old-fart 80-character limit for better readability. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/44 --- extensions/places-menu/placeDisplay.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index 9885d0a8..568184d0 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -134,17 +134,16 @@ class RootInfo extends PlaceInfo { _init() { super._init('devices', Gio.File.new_for_path('/'), _("Computer")); - this._proxy = new Hostname1(Gio.DBus.system, - 'org.freedesktop.hostname1', - '/org/freedesktop/hostname1', - (obj, error) => { - if (error) - return; + let busName = 'org.freedesktop.hostname1'; + let objPath = '/org/freedesktop/hostname1'; + this._proxy = new Hostname1(Gio.DBus.system, busName, objPath, (obj, error) => { + if (error) + return; - this._proxy.connect('g-properties-changed', - this._propertiesChanged.bind(this)); - this._propertiesChanged(obj); - }); + this._proxy.connect('g-properties-changed', + this._propertiesChanged.bind(this)); + this._propertiesChanged(obj); + }); } getIcon() { From 3284fe81d7cdb362fc7d8013bf7d958b253c4b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 17 Jan 2018 21:57:49 +0100 Subject: [PATCH 43/60] places-menu: Don't force dispose() of uninitialized proxies Trying to dispose a proxy object before it has been properly initialized triggers an "uncatchable exception", which gjs treats as a fatal error since commit c7bdcaab4. We only have anything to clean up once the proxy is initialized anyway, so don't force dispose() before that. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/44 --- extensions/places-menu/placeDisplay.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index 568184d0..4fe6808f 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -136,10 +136,11 @@ class RootInfo extends PlaceInfo { let busName = 'org.freedesktop.hostname1'; let objPath = '/org/freedesktop/hostname1'; - this._proxy = new Hostname1(Gio.DBus.system, busName, objPath, (obj, error) => { + new Hostname1(Gio.DBus.system, busName, objPath, (obj, error) => { if (error) return; + this._proxy = obj; this._proxy.connect('g-properties-changed', this._propertiesChanged.bind(this)); this._propertiesChanged(obj); @@ -160,7 +161,10 @@ class RootInfo extends PlaceInfo { } destroy() { - this._proxy.run_dispose(); + if (this._proxy) { + this._proxy.run_dispose(); + this._proxy = null; + } super.destroy(); } }; From 3b6cd04a59bc9616f4873dabe52ec440bc2d17d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 22 Dec 2017 01:07:06 +0100 Subject: [PATCH 44/60] auto-move-windows: Do not copy checkWorkspaces() method When overriding an upstream method, copying the original method code should always be a last resort, as the two code bases tend to get out of sync and it often becomes hard to spot the modifications done by the override. Both those issues can be avoided when figuring out a way to split out the modifications and call the unmodified upstream method - we are in luck with our checkWorkspaces() override, as we can trick the upstream method into not removing workspaces we want to keep instead of copying the method altogether. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/33 --- extensions/auto-move-windows/extension.js | 65 ++++------------------- 1 file changed, 11 insertions(+), 54 deletions(-) diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index ca9cd905..6bf4b397 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -4,7 +4,6 @@ const Glib = imports.gi.GLib; const Gio = imports.gi.Gio; const Mainloop = imports.mainloop; -const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; const St = imports.gi.St; @@ -85,62 +84,20 @@ function init() { } function myCheckWorkspaces() { - let i; - let emptyWorkspaces = new Array(this._workspaces.length); - - if (!Meta.prefs_get_dynamic_workspaces()) { - this._checkWorkspacesId = 0; - return false; + let keepAliveWorkspaces = []; + let foundNonEmpty = false; + for (let i = this._workspaces.length - 1; i >= 0; i--) { + if (!foundNonEmpty) + foundNonEmpty = this._workspaces[i].list_windows().length > 0; + else if (!this._workspaces[i]._keepAliveId) + keepAliveWorkspaces.push(this._workspaces[i]); } - for (i = 0; i < this._workspaces.length; i++) { - let lastRemoved = this._workspaces[i]._lastRemovedWindow; - if ((lastRemoved && - (lastRemoved.get_window_type() == Meta.WindowType.SPLASHSCREEN || - lastRemoved.get_window_type() == Meta.WindowType.DIALOG || - lastRemoved.get_window_type() == Meta.WindowType.MODAL_DIALOG)) || - this._workspaces[i]._keepAliveId) - emptyWorkspaces[i] = false; - else - emptyWorkspaces[i] = true; - } + // make sure the original method only removes empty workspaces at the end + keepAliveWorkspaces.forEach(ws => { ws._keepAliveId = 1; }); + prevCheckWorkspaces.call(this); + keepAliveWorkspaces.forEach(ws => { delete ws._keepAliveId; }); - let sequences = Shell.WindowTracker.get_default().get_startup_sequences(); - for (i = 0; i < sequences.length; i++) { - let index = sequences[i].get_workspace(); - if (index >= 0 && index <= global.screen.n_workspaces) - emptyWorkspaces[index] = false; - } - - let windows = global.get_window_actors(); - for (i = 0; i < windows.length; i++) { - let winActor = windows[i]; - let win = winActor.meta_window; - if (win.is_on_all_workspaces()) - continue; - - let workspaceIndex = win.get_workspace().index(); - emptyWorkspaces[workspaceIndex] = false; - } - - // If we don't have an empty workspace at the end, add one - if (!emptyWorkspaces[emptyWorkspaces.length -1]) { - global.screen.append_new_workspace(false, global.get_current_time()); - emptyWorkspaces.push(false); - } - - let activeWorkspaceIndex = global.screen.get_active_workspace_index(); - emptyWorkspaces[activeWorkspaceIndex] = false; - - // Delete other empty workspaces; do it from the end to avoid index changes - for (i = emptyWorkspaces.length - 2; i >= 0; i--) { - if (emptyWorkspaces[i]) - global.screen.remove_workspace(this._workspaces[i], global.get_current_time()); - else - break; - } - - this._checkWorkspacesId = 0; return false; } From 9ecd6bbb134f408b890d301efd07fd804c8eff98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 16 Jan 2018 20:49:04 +0100 Subject: [PATCH 45/60] auto-move-windows: Remove unused imports https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/33 --- extensions/auto-move-windows/extension.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index 6bf4b397..cd7aa0d8 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -1,11 +1,8 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- // Start apps on custom workspaces -const Glib = imports.gi.GLib; -const Gio = imports.gi.Gio; const Mainloop = imports.mainloop; const Shell = imports.gi.Shell; -const St = imports.gi.St; const Main = imports.ui.main; From ec98cff9d9796598f0bb6ebced031dacb502e0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 22 Dec 2017 01:58:12 +0100 Subject: [PATCH 46/60] auto-move-windows: Minor style cleanups Use camelCase for variable names, call the first index variable 'i' instead of 'j', and fix some whitespace errors. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/33 --- extensions/auto-move-windows/extension.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index cd7aa0d8..d759f074 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -32,8 +32,8 @@ class WindowMover { } _ensureAtLeastWorkspaces(num, window) { - for (let j = global.screen.n_workspaces; j <= num; j++) { - window.change_workspace_by_index(j-1, false); + for (let i = global.screen.n_workspaces; i <= num; i++) { + window.change_workspace_by_index(i - 1, false); global.screen.append_new_workspace(false, 0); } } @@ -57,16 +57,16 @@ class WindowMover { return; } let app_id = app.get_id(); - for ( let j = 0 ; j < spaces.length; j++ ) { - let apps_to_space = spaces[j].split(":"); + for (let i = 0; i < spaces.length; i++) { + let appsToSpace = spaces[i].split(":"); // Match application id - if (apps_to_space[0] == app_id) { - let workspace_num = parseInt(apps_to_space[1]) - 1; + if (appsToSpace[0] == app_id) { + let workspaceNum = parseInt(appsToSpace[1]) - 1; - if (workspace_num >= global.screen.n_workspaces) + if (workspaceNum >= global.screen.n_workspaces) this._ensureAtLeastWorkspaces(workspace_num, window); - window.change_workspace_by_index(workspace_num, false); + window.change_workspace_by_index(workspaceNum, false); } } } From 0721ed6504ee8af37804b5d5fdc05f3e63799905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 21 Dec 2017 21:13:13 +0100 Subject: [PATCH 47/60] auto-move-windows: Cache app configuration in map While reading the configuration, processing it and iterating over the configured apps to find a match isn't terribly expensive, but caching the configuration in a map does save a bit of work, and makes for much cleaner code in findAndMove(). https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/33 --- extensions/auto-move-windows/extension.js | 43 +++++++++++++---------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index d759f074..92ce7b16 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -10,18 +10,27 @@ const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); const Convenience = Me.imports.convenience; -const SETTINGS_KEY = 'application-list'; - -let settings; - class WindowMover { constructor() { - this._settings = settings; + this._settings = Convenience.getSettings(); this._windowTracker = Shell.WindowTracker.get_default(); + this._appConfigs = new Map(); let display = global.screen.get_display(); // Connect after so the handler from ShellWindowTracker has already run this._windowCreatedId = display.connect_after('window-created', this._findAndMove.bind(this)); + + this._settings.connect('changed', this._updateAppConfigs.bind(this)); + this._updateAppConfigs(); + } + + _updateAppConfigs() { + this._appConfigs.clear(); + + this._settings.get_strv('application-list').forEach(v => { + let [appId, num] = v.split(':'); + this._appConfigs.set(appId, parseInt(num) - 1); + }); } destroy() { @@ -29,6 +38,11 @@ class WindowMover { global.screen.get_display().disconnect(this._windowCreatedId); this._windowCreatedId = 0; } + + if (this._settings) { + this._settings.run_dispose(); + this._settings = null; + } } _ensureAtLeastWorkspaces(num, window) { @@ -42,8 +56,6 @@ class WindowMover { if (window.skip_taskbar) return; - let spaces = this._settings.get_strv(SETTINGS_KEY); - let app = this._windowTracker.get_window_app(window); if (!app) { if (!noRecurse) { @@ -56,18 +68,12 @@ class WindowMover { log ('Cannot find application for window'); return; } - let app_id = app.get_id(); - for (let i = 0; i < spaces.length; i++) { - let appsToSpace = spaces[i].split(":"); - // Match application id - if (appsToSpace[0] == app_id) { - let workspaceNum = parseInt(appsToSpace[1]) - 1; + let workspaceNum = this._appConfigs.get(app.get_id()); + if (workspaceNum !== undefined) { + if (workspaceNum >= global.screen.n_workspaces) + this._ensureAtLeastWorkspaces(workspaceNum, window); - if (workspaceNum >= global.screen.n_workspaces) - this._ensureAtLeastWorkspaces(workspace_num, window); - - window.change_workspace_by_index(workspaceNum, false); - } + window.change_workspace_by_index(workspaceNum, false); } } }; @@ -77,7 +83,6 @@ let winMover; function init() { Convenience.initTranslations(); - settings = Convenience.getSettings(); } function myCheckWorkspaces() { From 3b5a1486de3f4d2247c39d49b14695a27249c5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 21 Dec 2017 21:01:53 +0100 Subject: [PATCH 48/60] auto-move-windows: Track apps' windows instead of window creation We currently track window creation to decide whether the new window should be moved or not. In order for this to work, the window must already have been matched to the correct application, which is only the case when the properties used for app matching were supplied during window creation. This is usually the case on X11, but never on wayland. To avoid this issue altogether, stop listening for raw window creations, and instead track when a window is added to an application we are interested in. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/33 --- extensions/auto-move-windows/extension.js | 95 +++++++++++++++-------- 1 file changed, 62 insertions(+), 33 deletions(-) diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index 92ce7b16..5e4bd6d8 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -1,7 +1,6 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- // Start apps on custom workspaces -const Mainloop = imports.mainloop; const Shell = imports.gi.Shell; const Main = imports.ui.main; @@ -13,12 +12,13 @@ const Convenience = Me.imports.convenience; class WindowMover { constructor() { this._settings = Convenience.getSettings(); - this._windowTracker = Shell.WindowTracker.get_default(); + this._appSystem = Shell.AppSystem.get_default(); this._appConfigs = new Map(); + this._appData = new Map(); - let display = global.screen.get_display(); - // Connect after so the handler from ShellWindowTracker has already run - this._windowCreatedId = display.connect_after('window-created', this._findAndMove.bind(this)); + this._appsChangedId = + this._appSystem.connect('installed-changed', + this._updateAppData.bind(this)); this._settings.connect('changed', this._updateAppConfigs.bind(this)); this._updateAppConfigs(); @@ -31,50 +31,79 @@ class WindowMover { let [appId, num] = v.split(':'); this._appConfigs.set(appId, parseInt(num) - 1); }); + + this._updateAppData(); + } + + _updateAppData() { + let ids = [...this._appConfigs.keys()]; + let removedApps = [...this._appData.keys()].filter( + a => !ids.includes(a.id) + ); + removedApps.forEach(app => { + app.disconnect(this._appData.get(app).windowsChangedId); + this._appData.delete(app); + }); + + let addedApps = ids.map(id => this._appSystem.lookup_app(id)).filter( + app => app != null && !this._appData.has(app) + ); + addedApps.forEach(app => { + let data = { + windowsChangedId: app.connect('windows-changed', + this._appWindowsChanged.bind(this)), + moveWindowsId: 0, + windows: app.get_windows() + } + this._appData.set(app, data); + }); } destroy() { - if (this._windowCreatedId) { - global.screen.get_display().disconnect(this._windowCreatedId); - this._windowCreatedId = 0; + if (this._appsChangedId) { + this._appSystem.disconnect(this._appsChangedId); + this._appsChangedId = 0; } if (this._settings) { this._settings.run_dispose(); this._settings = null; } + + this._appConfigs.clear(); + this._updateAppData(); } - _ensureAtLeastWorkspaces(num, window) { - for (let i = global.screen.n_workspaces; i <= num; i++) { - window.change_workspace_by_index(i - 1, false); - global.screen.append_new_workspace(false, 0); - } - } - - _findAndMove(display, window, noRecurse) { + _moveWindow(window, workspaceNum) { if (window.skip_taskbar) return; - let app = this._windowTracker.get_window_app(window); - if (!app) { - if (!noRecurse) { - // window is not tracked yet - Mainloop.idle_add(() => { - this._findAndMove(display, window, true); - return false; - }); - } else - log ('Cannot find application for window'); - return; + // ensure we have the required number of workspaces + for (let i = global.screen.n_workspaces; i <= workspaceNum; i++) { + window.change_workspace_by_index(i - 1, false); + global.screen.append_new_workspace(false, 0); } - let workspaceNum = this._appConfigs.get(app.get_id()); - if (workspaceNum !== undefined) { - if (workspaceNum >= global.screen.n_workspaces) - this._ensureAtLeastWorkspaces(workspaceNum, window); - window.change_workspace_by_index(workspaceNum, false); - } + window.change_workspace_by_index(workspaceNum, false); + } + + _appWindowsChanged(app) { + let data = this._appData.get(app); + let windows = app.get_windows(); + + // If get_compositor_private() returns non-NULL on a removed windows, + // the window still exists and is just moved to a different workspace + // or something; assume it'll be added back immediately, so keep it + // to avoid moving it again + windows.push(...data.windows.filter( + w => !windows.includes(w) && w.get_compositor_private() != null + )); + + let workspaceNum = this._appConfigs.get(app.id); + windows.filter(w => !data.windows.includes(w)).forEach(window => { + this._moveWindow(window, workspaceNum); + }); + data.windows = windows; } }; From 8881fbcc9d389155a71d173461c6aefcf919438c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 17 Jan 2018 18:26:51 +0100 Subject: [PATCH 49/60] classic: Fix "Clear All" button readability --- data/gnome-classic.css | 3 +++ data/gnome-classic.scss | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/data/gnome-classic.css b/data/gnome-classic.css index 086fa125..2bb18b04 100644 --- a/data/gnome-classic.css +++ b/data/gnome-classic.css @@ -1955,3 +1955,6 @@ StScrollBar { .calendar-day-with-events { background-image: url("calendar-today.svg"); } + +.message-list-clear-button.button { + color: #2e3436; } diff --git a/data/gnome-classic.scss b/data/gnome-classic.scss index 274a3f8b..b4c3de10 100644 --- a/data/gnome-classic.scss +++ b/data/gnome-classic.scss @@ -86,3 +86,7 @@ $variant: 'light'; .calendar-day-with-events { background-image: url("calendar-today.svg"); } + +.message-list-clear-button.button { + color: $fg_color +} From 7de28858e1183d4a5ec6703ad43fc61b5b67d3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 17 Jan 2018 18:44:10 +0100 Subject: [PATCH 50/60] WIP: Disable places-menu extension For whatever reason it prevents the classic session to come up?! --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index 23a0cfc0..eea0ba78 100644 --- a/meson.build +++ b/meson.build @@ -37,7 +37,6 @@ uuid_suffix = '@gnome-shell-extensions.gcampax.github.com' classic_extensions = [ 'alternate-tab', 'apps-menu', - 'places-menu', 'launch-new-instance', 'window-list' ] From 2dbe692a31b44a84e5de07db93a03c4aaf4b83f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 18 Jan 2018 13:44:36 +0100 Subject: [PATCH 51/60] Revert last two commits Gah, nasty accident :-( --- data/gnome-classic.css | 3 --- data/gnome-classic.scss | 4 ---- meson.build | 1 + 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/data/gnome-classic.css b/data/gnome-classic.css index 2bb18b04..086fa125 100644 --- a/data/gnome-classic.css +++ b/data/gnome-classic.css @@ -1955,6 +1955,3 @@ StScrollBar { .calendar-day-with-events { background-image: url("calendar-today.svg"); } - -.message-list-clear-button.button { - color: #2e3436; } diff --git a/data/gnome-classic.scss b/data/gnome-classic.scss index b4c3de10..274a3f8b 100644 --- a/data/gnome-classic.scss +++ b/data/gnome-classic.scss @@ -86,7 +86,3 @@ $variant: 'light'; .calendar-day-with-events { background-image: url("calendar-today.svg"); } - -.message-list-clear-button.button { - color: $fg_color -} diff --git a/meson.build b/meson.build index eea0ba78..23a0cfc0 100644 --- a/meson.build +++ b/meson.build @@ -37,6 +37,7 @@ uuid_suffix = '@gnome-shell-extensions.gcampax.github.com' classic_extensions = [ 'alternate-tab', 'apps-menu', + 'places-menu', 'launch-new-instance', 'window-list' ] From ae65a82fdd5ea25742aebe126ddc70e9b7f396f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 17 Jan 2018 18:26:51 +0100 Subject: [PATCH 52/60] classic: Fix "Clear All" button readability Most buttons appear in modal dialogs which keep their normal appearance in the classic theme, except for the calendar's "Clear All" which needs a dark text color to be readable on the light background. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/26 --- data/gnome-classic.css | 3 +++ data/gnome-classic.scss | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/data/gnome-classic.css b/data/gnome-classic.css index 086fa125..2bb18b04 100644 --- a/data/gnome-classic.css +++ b/data/gnome-classic.css @@ -1955,3 +1955,6 @@ StScrollBar { .calendar-day-with-events { background-image: url("calendar-today.svg"); } + +.message-list-clear-button.button { + color: #2e3436; } diff --git a/data/gnome-classic.scss b/data/gnome-classic.scss index 274a3f8b..b4c3de10 100644 --- a/data/gnome-classic.scss +++ b/data/gnome-classic.scss @@ -86,3 +86,7 @@ $variant: 'light'; .calendar-day-with-events { background-image: url("calendar-today.svg"); } + +.message-list-clear-button.button { + color: $fg_color +} From f9ad051367a427b607b6490e2d34287534529593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20K=C3=BCmmerlin?= Date: Wed, 24 Jan 2018 22:07:36 +0100 Subject: [PATCH 53/60] classic: make notifications legible again https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/41 As requested in discussion about !26, this is resolved by switching to a light background. --- data/gnome-classic.css | 8 ++++++++ data/gnome-classic.scss | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/data/gnome-classic.css b/data/gnome-classic.css index 2bb18b04..db71e0df 100644 --- a/data/gnome-classic.css +++ b/data/gnome-classic.css @@ -1958,3 +1958,11 @@ StScrollBar { .message-list-clear-button.button { color: #2e3436; } + +.notification-banner { + background-color: #ededed !important; + color: #2e3436; } + .notification-banner .notification-button { + background-color: #e0e0e0; } + .notification-banner .notification-button:hover, .notification-banner .notification-buttonfocus { + background-color: #e8e8e8; } diff --git a/data/gnome-classic.scss b/data/gnome-classic.scss index b4c3de10..63302e7c 100644 --- a/data/gnome-classic.scss +++ b/data/gnome-classic.scss @@ -90,3 +90,12 @@ $variant: 'light'; .message-list-clear-button.button { color: $fg_color } + +.notification-banner { + background-color: $bg_color !important; + color: $fg_color; + .notification-button { + background-color: darken($bg_color,5%); + &:hover, &focus { background-color: darken($bg_color,2%); } + } +} From 3398e740059b2ec942cc546fb9905d70c4b48cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20K=C3=BCmmerlin?= Date: Wed, 24 Jan 2018 22:24:06 +0100 Subject: [PATCH 54/60] classic: never show drop shadow for panel icons https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/39 --- data/gnome-classic.css | 2 ++ data/gnome-classic.scss | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/data/gnome-classic.css b/data/gnome-classic.css index db71e0df..9a66d586 100644 --- a/data/gnome-classic.css +++ b/data/gnome-classic.css @@ -1917,6 +1917,8 @@ StScrollBar { width: 0; height: 0; margin: 0; } + #panel .panel-button .system-status-icon { + icon-shadow: none; } #panel .panel-corner, #panel .panel-corner:active, #panel .panel-corner:overview, diff --git a/data/gnome-classic.scss b/data/gnome-classic.scss index 63302e7c..55eacdfb 100644 --- a/data/gnome-classic.scss +++ b/data/gnome-classic.scss @@ -45,6 +45,10 @@ $variant: 'light'; & .system-status-icon { icon-shadow: none; } } .app-menu-icon { width: 0; height: 0; margin: 0; } // shell's display:none; :D + + .system-status-icon { + icon-shadow: none; + } } .panel-corner, From ff3adb84296044bf9297856ee25dc0622dbf92b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20K=C3=BCmmerlin?= Date: Wed, 24 Jan 2018 22:16:24 +0100 Subject: [PATCH 55/60] classic: fix panel gradient in overview https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/40 --- data/gnome-classic.css | 35 +++++++++++++++++++---------------- data/gnome-classic.scss | 6 +++--- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/data/gnome-classic.css b/data/gnome-classic.css index 9a66d586..49807c03 100644 --- a/data/gnome-classic.css +++ b/data/gnome-classic.css @@ -1878,9 +1878,9 @@ StScrollBar { padding: 6px; } /* Overrides */ -#panel { +#panel, #panel.solid { font-weight: normal; - background-color: #ededed !important; + background-color: #ededed; background-gradient-direction: vertical; background-gradient-end: #e0e0e0; border-top-color: #666; @@ -1890,48 +1890,51 @@ StScrollBar { border */ border-bottom: 1px solid #666; app-icon-bottom-clip: 0px; } - #panel:overview { + #panel:overview, #panel.solid:overview { background-color: #000; background-gradient-end: #000; border-top-color: #000; border-bottom: 1px solid #000; } - #panel:overview .panel-button { + #panel:overview .panel-button, #panel.solid:overview .panel-button { color: #fff; } - #panel .panel-button { + #panel .panel-button, #panel.solid .panel-button { -natural-hpadding: 8px; -minimum-hpadding: 4px; font-weight: normal; - color: #2e3436 !important; + color: #2e3436; text-shadow: none; } - #panel .panel-button:active, #panel .panel-button:overview, #panel .panel-button:focus, #panel .panel-button:checked { + #panel .panel-button:active, #panel .panel-button:overview, #panel .panel-button:focus, #panel .panel-button:checked, #panel.solid .panel-button:active, #panel.solid .panel-button:overview, #panel.solid .panel-button:focus, #panel.solid .panel-button:checked { background-color: #4a90d9 !important; color: #ffffff !important; box-shadow: none; } - #panel .panel-button:active > .system-status-icon, #panel .panel-button:overview > .system-status-icon, #panel .panel-button:focus > .system-status-icon, #panel .panel-button:checked > .system-status-icon { + #panel .panel-button:active > .system-status-icon, #panel .panel-button:overview > .system-status-icon, #panel .panel-button:focus > .system-status-icon, #panel .panel-button:checked > .system-status-icon, #panel.solid .panel-button:active > .system-status-icon, #panel.solid .panel-button:overview > .system-status-icon, #panel.solid .panel-button:focus > .system-status-icon, #panel.solid .panel-button:checked > .system-status-icon { icon-shadow: none; } - #panel .panel-button:hover { + #panel .panel-button:hover, #panel.solid .panel-button:hover { text-shadow: none; } - #panel .panel-button:hover .system-status-icon { + #panel .panel-button:hover .system-status-icon, #panel.solid .panel-button:hover .system-status-icon { icon-shadow: none; } - #panel .panel-button .app-menu-icon { + #panel .panel-button .app-menu-icon, #panel.solid .panel-button .app-menu-icon { width: 0; height: 0; margin: 0; } - #panel .panel-button .system-status-icon { + #panel .panel-button .system-status-icon, #panel.solid .panel-button .system-status-icon { icon-shadow: none; } #panel .panel-corner, #panel .panel-corner:active, #panel .panel-corner:overview, - #panel .panel-corner:focus { + #panel .panel-corner:focus, #panel.solid .panel-corner, + #panel.solid .panel-corner:active, + #panel.solid .panel-corner:overview, + #panel.solid .panel-corner:focus { -panel-corner-radius: 0; } - #panel.lock-screen, #panel.unlock-screen, #panel.login-screen { + #panel.lock-screen, #panel.unlock-screen, #panel.login-screen, #panel.solid.lock-screen, #panel.solid.unlock-screen, #panel.solid.login-screen { background-color: rgba(46, 52, 54, 0.5); background-gradient-start: rgba(46, 52, 54, 0.5); background-gradient-end: rgba(46, 52, 54, 0.5); border-bottom: none; } - #panel.lock-screen .panel-button, #panel.unlock-screen .panel-button, #panel.login-screen .panel-button { + #panel.lock-screen .panel-button, #panel.unlock-screen .panel-button, #panel.login-screen .panel-button, #panel.solid.lock-screen .panel-button, #panel.solid.unlock-screen .panel-button, #panel.solid.login-screen .panel-button { color: #eeeeec; } - #panel .popup-menu-arrow { + #panel .popup-menu-arrow, #panel.solid .popup-menu-arrow { width: 0; height: 0; } diff --git a/data/gnome-classic.scss b/data/gnome-classic.scss index 55eacdfb..9e23506a 100644 --- a/data/gnome-classic.scss +++ b/data/gnome-classic.scss @@ -7,9 +7,9 @@ $variant: 'light'; /* Overrides */ -#panel { +#panel, #panel.solid { font-weight: normal; - background-color: $bg_color !important; + background-color: $bg_color; background-gradient-direction: vertical; background-gradient-end: darken($bg_color,5%); border-top-color: #666; /* we don't support non-uniform border-colors and @@ -30,7 +30,7 @@ $variant: 'light'; -natural-hpadding: 8px; -minimum-hpadding: 4px; font-weight: normal; - color: $fg_color !important; + color: $fg_color; text-shadow: none; &:active, &:overview, &:focus, &:checked { // Trick due to St limitations. It needs a background to draw From 7de345fc8b361985228eea8b85f995c788dce950 Mon Sep 17 00:00:00 2001 From: Jeremy Bicha Date: Sat, 17 Feb 2018 15:54:41 -0500 Subject: [PATCH 56/60] data: Adjust to another g-s-d plugin removal --- data/gnome-classic.session.desktop.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/gnome-classic.session.desktop.in b/data/gnome-classic.session.desktop.in index 392ec370..c26a8878 100644 --- a/data/gnome-classic.session.desktop.in +++ b/data/gnome-classic.session.desktop.in @@ -1,3 +1,3 @@ [GNOME Session] Name=GNOME Classic -RequiredComponents=org.gnome.Shell;org.gnome.SettingsDaemon.A11yKeyboard;org.gnome.SettingsDaemon.A11ySettings;org.gnome.SettingsDaemon.Clipboard;org.gnome.SettingsDaemon.Color;org.gnome.SettingsDaemon.Datetime;org.gnome.SettingsDaemon.Housekeeping;org.gnome.SettingsDaemon.Keyboard;org.gnome.SettingsDaemon.MediaKeys;org.gnome.SettingsDaemon.Mouse;org.gnome.SettingsDaemon.Power;org.gnome.SettingsDaemon.PrintNotifications;org.gnome.SettingsDaemon.Rfkill;org.gnome.SettingsDaemon.ScreensaverProxy;org.gnome.SettingsDaemon.Sharing;org.gnome.SettingsDaemon.Smartcard;org.gnome.SettingsDaemon.Sound;org.gnome.SettingsDaemon.Wacom;org.gnome.SettingsDaemon.XSettings;nautilus-classic; +RequiredComponents=org.gnome.Shell;org.gnome.SettingsDaemon.A11ySettings;org.gnome.SettingsDaemon.Clipboard;org.gnome.SettingsDaemon.Color;org.gnome.SettingsDaemon.Datetime;org.gnome.SettingsDaemon.Housekeeping;org.gnome.SettingsDaemon.Keyboard;org.gnome.SettingsDaemon.MediaKeys;org.gnome.SettingsDaemon.Mouse;org.gnome.SettingsDaemon.Power;org.gnome.SettingsDaemon.PrintNotifications;org.gnome.SettingsDaemon.Rfkill;org.gnome.SettingsDaemon.ScreensaverProxy;org.gnome.SettingsDaemon.Sharing;org.gnome.SettingsDaemon.Smartcard;org.gnome.SettingsDaemon.Sound;org.gnome.SettingsDaemon.Wacom;org.gnome.SettingsDaemon.XSettings;nautilus-classic; From b80aa8ee11e5cb7c5d95eeb513f501d466a052ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Dr=C4=85g?= Date: Wed, 21 Feb 2018 00:05:55 +0100 Subject: [PATCH 57/60] Remove po/Makevars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Meson doesn’t use it, and Damned Lies learned to read po/meson.build. --- po/Makevars | 68 ----------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 po/Makevars diff --git a/po/Makevars b/po/Makevars deleted file mode 100644 index cc7503d6..00000000 --- a/po/Makevars +++ /dev/null @@ -1,68 +0,0 @@ -# Makefile variables for PO directory in any package using GNU gettext. - -# Usually the message domain is the same as the package name. -DOMAIN = $(PACKAGE) - -# These two variables depend on the location of this directory. -subdir = po -top_builddir = .. - -# These options get passed to xgettext. -XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ \ - --keyword=C_:1c,2 --keyword=NC_:1c,2 \ - --keyword=g_dngettext:2,3 --add-comments \ - --flag=g_dngettext:2:pass-c-format \ - --flag=g_strdup_printf:1:c-format \ - --flag=g_string_printf:2:c-format \ - --flag=g_string_append_printf:2:c-format \ - --flag=g_error_new:3:c-format \ - --flag=g_set_error:4:c-format \ - --flag=g_markup_printf_escaped:1:c-format \ - --flag=g_log:3:c-format \ - --flag=g_print:1:c-format \ - --flag=g_printerr:1:c-format \ - --flag=g_printf:1:c-format \ - --flag=g_fprintf:2:c-format \ - --flag=g_sprintf:2:c-format \ - --flag=g_snprintf:3:c-format - - -# This is the copyright holder that gets inserted into the header of the -# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding -# package. (Note that the msgstr strings, extracted from the package's -# sources, belong to the copyright holder of the package.) Translators are -# expected to transfer the copyright for their translations to this person -# or entity, or to disclaim their copyright. The empty string stands for -# the public domain; in this case the translators are expected to disclaim -# their copyright. -COPYRIGHT_HOLDER = Translation copyright holder -# This is the email address or URL to which the translators shall report -# bugs in the untranslated strings: -# - Strings which are not entire sentences, see the maintainer guidelines -# in the GNU gettext documentation, section 'Preparing Strings'. -# - Strings which use unclear terms or require additional context to be -# understood. -# - Strings which make invalid assumptions about notation of date, time or -# money. -# - Pluralisation problems. -# - Incorrect English spelling. -# - Incorrect formatting. -# It can be your email address, or a mailing list address where translators -# can write to without being subscribed, or the URL of a web page through -# which the translators can contact you. -MSGID_BUGS_ADDRESS = http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell&keywords=I18N+L10N&component=extensions - -# This is the list of locale categories, beyond LC_MESSAGES, for which the -# message catalogs shall be used. It is usually empty. -EXTRA_LOCALE_CATEGORIES = - -# Ignore the timestamp of the .pot file, as git clones do not have -# deterministic timestamps, and .po files are updated by translators -# (only) in GNOME projects. -PO_DEPENDS_ON_POT = no - -# This tells whether or not to forcibly update $(DOMAIN).pot and -# regenerate PO files on "make dist". Possible values are "yes" and -# "no". Set this to no if the POT file and PO files are maintained -# externally. -DIST_DEPENDS_ON_UPDATE_PO = no From 5c0ef12d13dd2172af57165fd673bfb5a3c02dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 6 Feb 2018 00:42:58 +0100 Subject: [PATCH 58/60] build: Require sassc for classic style Meson has a strict separation of source- and build directory, and expects anything generated in the latter. That means that in order to maintain our current setup - shipping the generated CSS in the repo while also optionally updating it automatically when sassc is found - we have to fight the build system to some extent, which makes it less reliable than we would like. Since we switched to sassc which is a more acceptable build-time dependency than the original ruby-based tool, just drop the CSS from the repo and unconditionally generate it from SASS if classic mode is enabled. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/28 --- data/HACKING | 4 - data/gnome-classic.css | 1973 ---------------------------------------- data/meson.build | 22 +- data/update-theme.sh | 9 - meson.build | 2 +- 5 files changed, 10 insertions(+), 2000 deletions(-) delete mode 100644 data/gnome-classic.css delete mode 100755 data/update-theme.sh diff --git a/data/HACKING b/data/HACKING index 9b87ee29..8e053392 100644 --- a/data/HACKING +++ b/data/HACKING @@ -1,6 +1,2 @@ -To generate the css files, from the project directory: - -sassc -a gnome-classic.scss gnome-classic.css - To update the gnome-shell-sass submodule to latest upstream commit: git submodule update --rebase diff --git a/data/gnome-classic.css b/data/gnome-classic.css deleted file mode 100644 index 49807c03..00000000 --- a/data/gnome-classic.css +++ /dev/null @@ -1,1973 +0,0 @@ -/* Use the gnome-shell theme, but with light colors */ -/* This stylesheet is generated, DO NOT EDIT */ -/* Copyright 2009, 2015 Red Hat, Inc. - * - * Portions adapted from Mx's data/style/default.css - * Copyright 2009 Intel Corporation - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU Lesser General Public License, - * version 2.1, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - */ -/* GLOBALS */ -stage { - font-family: Cantarell, Sans-Serif; - font-size: 11pt; - color: #2e3436; } - -/* WIDGETS */ -/* Buttons */ -.button { - border-radius: 3px; - border-width: 1px; - padding: 4px 32px; - color: #eeeeec; - background-color: #2e3436; - border-color: rgba(0, 0, 0, 0.7); - box-shadow: inset 0 1px #454f52; - text-shadow: 0 1px black; - icon-shadow: 0 1px black; } - .button:focus { - color: #eeeeec; - text-shadow: 0 1px black; - icon-shadow: 0 1px black; - box-shadow: inset 0px 0px 0px 1px #4a90d9; } - .button:insensitive { - color: #8e9192; - border-color: rgba(0, 0, 0, 0.7); - background-color: rgba(65, 71, 72, 0.7); - box-shadow: none; - text-shadow: none; - icon-shadow: none; } - .button:active { - color: white; - border-color: rgba(0, 0, 0, 0.7); - background-color: #222728; - box-shadow: inset 0 0 black; - text-shadow: none; - icon-shadow: none; } - -.modal-dialog-linked-button { - border-right-width: 1px; - color: #eeeeec; - background-color: #2e3436; - border-color: rgba(0, 0, 0, 0.7); - box-shadow: inset 0 1px #454f52; - text-shadow: 0 1px black; - icon-shadow: 0 1px black; - padding: 12px; } - .modal-dialog-linked-button:insensitive { - color: #8e9192; - border-color: rgba(0, 0, 0, 0.7); - background-color: rgba(65, 71, 72, 0.7); - box-shadow: none; - text-shadow: none; - icon-shadow: none; } - .modal-dialog-linked-button:active { - color: white; - border-color: rgba(0, 0, 0, 0.7); - background-color: #222728; - box-shadow: inset 0 0 black; - text-shadow: none; - icon-shadow: none; } - .modal-dialog-linked-button:focus { - color: #eeeeec; - text-shadow: 0 1px black; - icon-shadow: 0 1px black; - box-shadow: inset 0px 0px 0px 1px #4a90d9; } - .modal-dialog-linked-button:first-child { - border-radius: 0px 0px 0px 6px; } - .modal-dialog-linked-button:last-child { - border-right-width: 0px; - border-radius: 0px 0px 6px 0px; } - .modal-dialog-linked-button:first-child:last-child { - border-right-width: 0px; - border-radius: 0px 0px 6px 6px; } - -/* Entries */ -StEntry { - border-radius: 3px; - padding: 4px; - border-width: 1px; - color: #2e3436; - background-color: #ffffff; - border-color: #a1a1a1; - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4); - selection-background-color: #4a90d9; - selected-color: #ffffff; } - StEntry:focus { - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4); - border-color: rgba(0, 0, 0, 0.5); } - StEntry:insensitive { - color: #8e9192; - border-color: #f4f4f4; - box-shadow: none; } - StEntry StIcon.capslock-warning { - icon-size: 16px; - warning-color: #f57900; - padding: 0 4px; } - -/* Scrollbars */ -StScrollView.vfade { - -st-vfade-offset: 68px; } - -StScrollView.hfade { - -st-hfade-offset: 68px; } - -StScrollBar { - padding: 0; } - StScrollView StScrollBar { - min-width: 14px; - min-height: 14px; } - StScrollBar StBin#trough { - border-radius: 0; - background-color: transparent; } - StScrollBar StButton#vhandle, StScrollBar StButton#hhandle { - border-radius: 8px; - background-color: #7a7e7f; - margin: 3px; } - StScrollBar StButton#vhandle:hover, StScrollBar StButton#hhandle:hover { - background-color: #54595b; } - StScrollBar StButton#vhandle:active, StScrollBar StButton#hhandle:active { - background-color: #4a90d9; } - -/* Slider */ -.slider { - height: 1em; - -slider-height: 0.3em; - -slider-background-color: #f4f4f4; - -slider-border-color: #a1a1a1; - -slider-active-background-color: #4a90d9; - -slider-active-border-color: #2a76c6; - -slider-border-width: 1px; - -slider-handle-radius: 6px; } - -/* Check Boxes */ -.check-box StBoxLayout { - spacing: .8em; } - -.check-box StBin { - width: 24px; - height: 22px; - background-image: url("resource:///org/gnome/shell/theme/checkbox-off.svg"); } - -.check-box:focus StBin { - background-image: url("resource:///org/gnome/shell/theme/checkbox-off-focused.svg"); } - -.check-box:checked StBin { - background-image: url("resource:///org/gnome/shell/theme/checkbox.svg"); } - -.check-box:focus:checked StBin { - background-image: url("resource:///org/gnome/shell/theme/checkbox-focused.svg"); } - -/* Switches */ -.toggle-switch { - width: 65px; - height: 22px; - background-size: contain; } - -.toggle-switch-us { - background-image: url("resource:///org/gnome/shell/theme/toggle-off-us.svg"); } - .toggle-switch-us:checked { - background-image: url("resource:///org/gnome/shell/theme/toggle-on-us.svg"); } - -.toggle-switch-intl { - background-image: url("resource:///org/gnome/shell/theme/toggle-off-intl.svg"); } - .toggle-switch-intl:checked { - background-image: url("resource:///org/gnome/shell/theme/toggle-on-intl.svg"); } - -/* links */ -.shell-link { - color: #2a76c6; } - .shell-link:hover { - color: #4a90d9; } - -/* Modal Dialogs */ -.headline { - font-size: 110%; } - -.lightbox { - background-color: black; } - -.flashspot { - background-color: white; } - -.modal-dialog { - border-radius: 9px; - color: #eeeeec; - background-color: rgba(23, 25, 26, 0.95); - border: 1px solid rgba(238, 238, 236, 0.2); } - .modal-dialog .modal-dialog-content-box { - padding: 24px; } - .modal-dialog .run-dialog-entry { - width: 20em; - margin-bottom: 6px; } - .modal-dialog .run-dialog-error-box { - padding-top: 16px; - spacing: 6px; } - .modal-dialog .run-dialog-button-box { - padding-top: 1em; } - .modal-dialog .run-dialog-label { - font-size: 12pt; - font-weight: bold; - color: #d6d6d1; - padding-bottom: .4em; } - -.mount-dialog-subject, -.end-session-dialog-subject { - font-size: 14pt; } - -/* Message Dialog */ -.message-dialog-main-layout { - padding: 12px 20px 0; - spacing: 12px; } - -.message-dialog-content { - max-width: 28em; - spacing: 20px; } - -.message-dialog-icon { - min-width: 48px; - icon-size: 48px; } - -.message-dialog-title { - font-weight: bold; } - -.message-dialog-subtitle { - color: black; - font-weight: bold; } - -/* End Session Dialog */ -.end-session-dialog { - spacing: 42px; - border: 1px solid rgba(238, 238, 236, 0.2); } - -.end-session-dialog-list { - padding-top: 20px; } - -.end-session-dialog-layout { - padding-left: 17px; } - .end-session-dialog-layout:rtl { - padding-right: 17px; } - -.end-session-dialog-description { - width: 28em; - padding-bottom: 10px; } - .end-session-dialog-description:rtl { - text-align: right; } - -.end-session-dialog-warning { - width: 28em; - color: #f57900; - padding-top: 6px; } - .end-session-dialog-warning:rtl { - text-align: right; } - -.end-session-dialog-logout-icon { - border-radius: 5px; - width: 48px; - height: 48px; - background-size: contain; } - -.end-session-dialog-shutdown-icon { - color: #2e3436; - width: 48px; - height: 48px; } - -.end-session-dialog-inhibitor-layout { - spacing: 16px; - max-height: 200px; - padding-right: 65px; - padding-left: 65px; } - -.end-session-dialog-session-list, -.end-session-dialog-app-list { - spacing: 1em; } - -.end-session-dialog-list-header { - font-weight: bold; } - .end-session-dialog-list-header:rtl { - text-align: right; } - -.end-session-dialog-app-list-item, -.end-session-dialog-session-list-item { - spacing: 1em; } - -.end-session-dialog-app-list-item-name, -.end-session-dialog-session-list-item-name { - font-weight: bold; } - -.end-session-dialog-app-list-item-description { - color: #222728; - font-size: 10pt; } - -/* ShellMountOperation Dialogs */ -.shell-mount-operation-icon { - icon-size: 48px; } - -.mount-dialog { - spacing: 24px; } - .mount-dialog .message-dialog-title { - padding-top: 10px; - padding-left: 17px; - padding-bottom: 6px; - max-width: 34em; } - .mount-dialog .message-dialog-title:rtl { - padding-left: 0px; - padding-right: 17px; } - .mount-dialog .message-dialog-body { - padding-left: 17px; - width: 28em; } - .mount-dialog .message-dialog-body:rtl { - padding-left: 0px; - padding-right: 17px; } - -.mount-dialog-app-list { - max-height: 200px; - padding-top: 24px; - padding-left: 49px; - padding-right: 32px; } - -.mount-dialog-app-list:rtl { - padding-right: 49px; - padding-left: 32px; } - -.mount-dialog-app-list-item { - color: #17191a; } - .mount-dialog-app-list-item:hover { - color: #2e3436; } - .mount-dialog-app-list-item:ltr { - padding-right: 1em; } - .mount-dialog-app-list-item:rtl { - padding-left: 1em; } - -.mount-dialog-app-list-item-icon:ltr { - padding-right: 17px; } - -.mount-dialog-app-list-item-icon:rtl { - padding-left: 17px; } - -.mount-dialog-app-list-item-name { - font-size: 10pt; } - -/* Password or Authentication Dialog */ -.prompt-dialog { - width: 34em; - border: 3px solid rgba(238, 238, 236, 0.2); } - .prompt-dialog .message-dialog-main-layout { - spacing: 24px; - padding: 10px; } - .prompt-dialog .message-dialog-content { - spacing: 16px; } - .prompt-dialog .message-dialog-title { - color: #b2b2a9; } - -.prompt-dialog-description:rtl { - text-align: right; } - -.prompt-dialog-password-box { - spacing: 1em; - padding-bottom: 1em; } - -.prompt-dialog-error-label { - font-size: 10pt; - color: #cc0000; - padding-bottom: 8px; } - -.prompt-dialog-info-label { - font-size: 10pt; - padding-bottom: 8px; } - -.hidden { - color: transparent; } - -.prompt-dialog-null-label { - font-size: 10pt; - padding-bottom: 8px; } - -/* Polkit Dialog */ -.polkit-dialog-user-layout { - padding-left: 10px; - spacing: 10px; } - .polkit-dialog-user-layout:rtl { - padding-left: 0px; - padding-right: 10px; } - -.polkit-dialog-user-root-label { - color: #f57900; } - -.polkit-dialog-user-icon { - border-radius: 5px; - background-size: contain; - width: 48px; - height: 48px; } - -/* Audio selection dialog */ -.audio-device-selection-dialog { - spacing: 30px; } - -.audio-selection-content { - spacing: 20px; - padding: 24px; } - -.audio-selection-title { - font-weight: bold; - text-align: center; } - -.audio-selection-box { - spacing: 20px; } - -.audio-selection-device { - border: 1px solid rgba(238, 238, 236, 0.2); - border-radius: 12px; } - .audio-selection-device:active, .audio-selection-device:hover, .audio-selection-device:focus { - background-color: #4a90d9; } - -.audio-selection-device-box { - padding: 20px; - spacing: 20px; } - -.audio-selection-device-icon { - icon-size: 64px; } - -/* Access Dialog */ -.access-dialog { - spacing: 30px; } - -/* Geolocation Dialog */ -.geolocation-dialog { - spacing: 30px; } - -/* Extension Dialog */ -.extension-dialog .message-dialog-main-layout { - spacing: 24px; - padding: 10px; } - -.extension-dialog .message-dialog-title { - color: #b2b2a9; } - -/* Inhibit-Shortcuts Dialog */ -.inhibit-shortcuts-dialog { - spacing: 30px; } - -/* Network Agent Dialog */ -.network-dialog-secret-table { - spacing-rows: 15px; - spacing-columns: 1em; } - -.keyring-dialog-control-table { - spacing-rows: 15px; - spacing-columns: 1em; } - -/* Popovers/Menus */ -.popup-menu { - min-width: 15em; } - .popup-menu .popup-sub-menu { - background-color: #e8e8e8; - box-shadow: inset 0 -1px 0px #adadad; } - .popup-menu .popup-menu-content { - padding: 1em 0em; } - .popup-menu .popup-menu-item { - spacing: 12px; } - .popup-menu .popup-menu-item:ltr { - padding: .4em 1.75em .4em 0em; } - .popup-menu .popup-menu-item:rtl { - padding: .4em 0em .4em 1.75em; } - .popup-menu .popup-menu-item:checked { - background-color: #e8e8e8; - box-shadow: inset 0 1px 0px #adadad; - font-weight: bold; } - .popup-menu .popup-menu-item.selected { - background-color: rgba(46, 52, 54, 0.1); - color: #2e3436; } - .popup-menu .popup-menu-item:active { - background-color: #4a90d9; - color: #ffffff; } - .popup-menu .popup-menu-item:insensitive { - color: rgba(46, 52, 54, 0.5); } - .popup-menu .popup-inactive-menu-item { - color: #2e3436; } - .popup-menu .popup-inactive-menu-item:insensitive { - color: rgba(46, 52, 54, 0.5); } - .popup-menu.panel-menu { - -boxpointer-gap: 4px; - margin-bottom: 1.75em; } - -.popup-menu-ornament { - text-align: right; - width: 1.2em; } - -.popup-menu-boxpointer, -.candidate-popup-boxpointer { - -arrow-border-radius: 3px; - -arrow-background-color: #ededed; - -arrow-border-width: 1px; - -arrow-border-color: #a1a1a1; - -arrow-base: 24px; - -arrow-rise: 11px; - -arrow-box-shadow: 0 1px 3px black; } - -.popup-separator-menu-item { - height: 1px; - margin: 6px 64px; - background-color: transparent; - border-color: #bababa; - border-bottom-width: 1px; - border-bottom-style: solid; } - -.background-menu { - -boxpointer-gap: 4px; - -arrow-rise: 0px; } - -/* fallback menu -- odd thing for styling App menu when apparently not running under shell. Light Adwaita styled - app menu inside the main app window itself rather than the top bar -*/ -/* OSD */ -.osd-window { - text-align: center; - font-weight: bold; - spacing: 1em; - margin: 32px; - min-width: 64px; - min-height: 64px; } - .osd-window .osd-monitor-label { - font-size: 3em; } - .osd-window .level { - height: 0.6em; - border-radius: 0.3em; - background-color: rgba(11, 12, 13, 0.5); - color: #eeeeec; } - .osd-window .level-bar { - background-color: #eeeeec; - border-radius: 0.3em; } - -/* Pad OSD */ -.pad-osd-window { - padding: 32px; - background-color: rgba(0, 0, 0, 0.8); } - .pad-osd-window .pad-osd-title-box { - spacing: 12px; } - .pad-osd-window .pad-osd-title-menu-box { - spacing: 6px; } - -.combo-box-label { - width: 15em; } - -/* App Switcher */ -.switcher-popup { - padding: 8px; - spacing: 16px; } - -.switcher-list-item-container { - spacing: 8px; } - -.switcher-list .item-box { - padding: 8px; - border-radius: 4px; } - -.switcher-list .item-box:outlined { - padding: 6px; - border: 2px solid #878787; } - -.switcher-list .item-box:selected { - background-color: #4a90d9; - color: #ffffff; } - -.switcher-list .thumbnail-box { - padding: 2px; - spacing: 4px; } - -.switcher-list .thumbnail { - width: 256px; } - -.switcher-list .separator { - width: 1px; - background: #a1a1a1; } - -.switcher-arrow { - border-color: transparent; - color: rgba(46, 52, 54, 0.8); } - .switcher-arrow:highlighted { - color: #2e3436; } - -.input-source-switcher-symbol { - font-size: 34pt; - width: 96px; - height: 96px; } - -/* Window Cycler */ -.cycler-highlight { - border: 5px solid #4a90d9; } - -/* Workspace Switcher */ -.workspace-switcher-group { - padding: 12px; } - -.workspace-switcher { - background: transparent; - border: 0px; - border-radius: 0px; - padding: 0px; - spacing: 8px; } - -.ws-switcher-active-up, .ws-switcher-active-down { - height: 50px; - background-color: #4a90d9; - color: #ffffff; - background-size: 32px; - border-radius: 8px; } - -.ws-switcher-box { - height: 50px; - border: 1px solid rgba(238, 238, 236, 0.1); - background: transparent; - border-radius: 8px; } - -.osd-window, -.resize-popup, -.switcher-list, .workspace-switcher-container { - color: #eeeeec; - background-color: #2e3436; - border: 1px solid rgba(238, 238, 236, 0.2); - border-radius: 12px; - padding: 12px; } - -/* Tiled window previews */ -.tile-preview { - background-color: rgba(74, 144, 217, 0.5); - border: 1px solid #4a90d9; } - -.tile-preview-left.on-primary { - border-radius: 6px 6px 0 0; } - -.tile-preview-right.on-primary { - border-radius: 0 6px 0 0; } - -.tile-preview-left.tile-preview-right.on-primary { - border-radius: 6px 6px 0 0; } - -/* TOP BAR */ -#panel { - background-color: rgba(0, 0, 0, 0.35); - /* transition from solid to transparent */ - transition-duration: 500ms; - font-weight: bold; - height: 1.86em; } - #panel.unlock-screen, #panel.login-screen, #panel.lock-screen { - background-color: transparent; } - #panel #panelLeft, #panel #panelCenter { - spacing: 4px; } - #panel .panel-corner { - -panel-corner-radius: 6px; - -panel-corner-background-color: rgba(0, 0, 0, 0.35); - -panel-corner-border-width: 2px; - -panel-corner-border-color: transparent; } - #panel .panel-corner:active, #panel .panel-corner:overview, #panel .panel-corner:focus { - -panel-corner-border-color: #5f9ddd; } - #panel .panel-corner.lock-screen, #panel .panel-corner.login-screen, #panel .panel-corner.unlock-screen { - -panel-corner-radius: 0; - -panel-corner-background-color: transparent; - -panel-corner-border-color: transparent; } - #panel .panel-button { - -natural-hpadding: 12px; - -minimum-hpadding: 6px; - font-weight: bold; - color: #eee; - text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.9); - transition-duration: 100ms; } - #panel .panel-button .app-menu-icon { - -st-icon-style: symbolic; - margin-left: 4px; - margin-right: 4px; } - #panel .panel-button .system-status-icon, - #panel .panel-button .app-menu-icon > StIcon, - #panel .panel-button .popup-menu-arrow { - icon-shadow: 0px 1px 2px rgba(0, 0, 0, 0.9); } - #panel .panel-button:hover { - color: #454f52; - text-shadow: 0px 1px 6px black; } - #panel .panel-button:hover .system-status-icon, - #panel .panel-button:hover .app-menu-icon > StIcon, - #panel .panel-button:hover .popup-menu-arrow { - icon-shadow: 0px 1px 6px black; } - #panel .panel-button:active, #panel .panel-button:overview, #panel .panel-button:focus, #panel .panel-button:checked { - background-color: rgba(0, 0, 0, 0.01); - box-shadow: inset 0 -2px 0px #5f9ddd; - color: #454f52; } - #panel .panel-button:active > .system-status-icon, #panel .panel-button:overview > .system-status-icon, #panel .panel-button:focus > .system-status-icon, #panel .panel-button:checked > .system-status-icon { - icon-shadow: black 0 2px 2px; } - #panel .panel-button .system-status-icon { - icon-size: 1.09em; - padding: 0 5px; } - .unlock-screen #panel .panel-button, - .login-screen #panel .panel-button, - .lock-screen #panel .panel-button { - color: #454f52; } - .unlock-screen #panel .panel-button:focus, .unlock-screen #panel .panel-button:hover, .unlock-screen #panel .panel-button:active, - .login-screen #panel .panel-button:focus, - .login-screen #panel .panel-button:hover, - .login-screen #panel .panel-button:active, - .lock-screen #panel .panel-button:focus, - .lock-screen #panel .panel-button:hover, - .lock-screen #panel .panel-button:active { - color: #454f52; } - #panel .panel-status-indicators-box, - #panel .panel-status-menu-box { - spacing: 2px; } - #panel .power-status.panel-status-indicators-box { - spacing: 0; } - #panel .screencast-indicator { - color: #f57900; } - #panel.solid { - background-color: black; - /* transition from transparent to solid */ - transition-duration: 300ms; } - #panel.solid .panel-corner { - -panel-corner-background-color: black; } - #panel.solid .panel-button { - color: #ccc; - text-shadow: none; } - #panel.solid .panel-button:hover { - color: #454f52; } - #panel.solid .system-status-icon, - #panel.solid .app-menu-icon > StIcon, - #panel.solid .popup-menu-arrow { - icon-shadow: none; } - -#calendarArea { - padding: 0.75em 1.0em; } - -.calendar { - margin-bottom: 1em; } - -.calendar, -.datemenu-today-button, -.datemenu-displays-box, -.message-list-sections { - margin: 0 1.5em; } - -.datemenu-calendar-column { - spacing: 0.5em; } - -.datemenu-displays-section { - padding-bottom: 3em; } - -.datemenu-displays-box { - spacing: 1em; } - -.datemenu-calendar-column { - border: 0 solid #fafafa; } - .datemenu-calendar-column:ltr { - border-left-width: 1px; } - .datemenu-calendar-column:rtl { - border-right-width: 1px; } - -.datemenu-today-button, -.world-clocks-button, -.weather-button, -.events-section-title { - border-radius: 4px; - padding: .4em; } - -.message-list-section-list:ltr { - padding-left: .4em; } - -.message-list-section-list:rtl { - padding-right: .4em; } - -.datemenu-today-button:hover, .datemenu-today-button:focus, -.world-clocks-button:hover, -.world-clocks-button:focus, -.weather-button:hover, -.weather-button:focus, -.events-section-title:hover, -.events-section-title:focus { - background-color: #fafafa; } - -.datemenu-today-button:active, -.world-clocks-button:active, -.weather-button:active, -.events-section-title:active { - color: white; - background-color: #4a90d9; } - -.datemenu-today-button .date-label { - font-size: 1.5em; } - -.world-clocks-header, -.weather-header, -.events-section-title { - color: black; - font-weight: bold; } - -.world-clocks-grid { - spacing-rows: 0.4em; } - -.weather-box { - spacing: 0.4em; } - -.calendar-month-label { - color: #222728; - font-weight: bold; - padding: 8px 0; } - -.pager-button { - color: white; - background-color: transparent; - width: 32px; - border-radius: 4px; } - .pager-button:hover, .pager-button:focus { - background-color: rgba(46, 52, 54, 0.05); } - .pager-button:active { - background-color: rgba(237, 237, 237, 0.05); } - -.calendar-change-month-back { - background-image: url("resource:///org/gnome/shell/theme/calendar-arrow-left.svg"); } - .calendar-change-month-back:rtl { - background-image: url("resource:///org/gnome/shell/theme/calendar-arrow-right.svg"); } - -.calendar-change-month-forward { - background-image: url("resource:///org/gnome/shell/theme/calendar-arrow-right.svg"); } - .calendar-change-month-forward:rtl { - background-image: url("resource:///org/gnome/shell/theme/calendar-arrow-left.svg"); } - -.calendar-day-base { - font-size: 80%; - text-align: center; - width: 2.4em; - height: 2.4em; - padding: 0.1em; - margin: 2px; - border-radius: 1.4em; } - .calendar-day-base:hover, .calendar-day-base:focus { - background-color: #fafafa; } - .calendar-day-base:active, .calendar-day-base:selected { - color: white; - background-color: #4a90d9; - border-color: transparent; } - .calendar-day-base.calendar-day-heading { - color: black; - margin-top: 1em; - font-size: 70%; } - -.calendar-day { - border-width: 0; } - -.calendar-day-top { - border-top-width: 1px; } - -.calendar-day-left { - border-left-width: 1px; } - -.calendar-nonwork-day { - color: #8e9192; } - -.calendar-today { - font-weight: bold; - border: 1px solid rgba(161, 161, 161, 0.5); } - -.calendar-day-with-events { - color: #454f52; - font-weight: bold; - background-image: url("resource:///org/gnome/shell/theme/calendar-today.svg"); } - -.calendar-other-month-day { - color: rgba(46, 52, 54, 0.15); - opacity: 0.5; } - -.calendar-week-number { - font-size: 70%; - font-weight: bold; - width: 2.3em; - height: 1.8em; - border-radius: 2px; - padding: 0.5em 0 0; - margin: 6px; - background-color: rgba(46, 52, 54, 0.3); - color: #ededed; } - -/* Message list */ -.message-list { - width: 31.5em; } - -.message-list-clear-button.button { - background-color: transparent; - margin: 1.5em 1.5em 0; } - .message-list-clear-button.button:hover, .message-list-clear-button.button:focus { - background-color: #fafafa; } - -.message-list-sections { - spacing: 1em; } - -.message-list-section, -.message-list-section-list { - spacing: 0.4em; } - -.message { - border-radius: 3px; } - .message:hover, .message:focus { - background-color: #fafafa; } - -.message-icon-bin { - padding: 0.68em 0.2em 0.68em 0.68em; } - .message-icon-bin:rtl { - padding: 0.68em 0.68em 0.68em 0.2em; } - -.message-icon-bin > StIcon { - color: black; - icon-size: 1.09em; - -st-icon-style: symbolic; } - -.message-secondary-bin { - padding: 0 0.82em; } - -.message-secondary-bin > .event-time { - color: black; - font-size: 0.7em; - /* HACK: the label should be baseline-aligned with a 1em label, - fake this with some bottom padding */ - padding-bottom: 0.13em; } - -.message-secondary-bin > StIcon { - icon-size: 1.09em; } - -.message-title { - color: #222728; } - -.message-content { - color: black; - padding: 10px; } - -.message-media-control { - padding: 12px; - color: black; } - .message-media-control:last-child:ltr { - padding-right: 18px; } - .message-media-control:last-child:rtl { - padding-left: 18px; } - .message-media-control:hover { - color: #2e3436; } - .message-media-control:insensitive { - color: black; } - -.media-message-cover-icon { - icon-size: 48px !important; } - .media-message-cover-icon.fallback { - color: white; - background-color: #ededed; - border: 2px solid #ededed; - border-radius: 2px; - icon-size: 16px; - padding: 8px; } - -.system-switch-user-submenu-icon.user-icon { - icon-size: 20px; - padding: 0 2px; } - -.system-switch-user-submenu-icon.default-icon { - icon-size: 16px; - padding: 0 4px; } - -#appMenu { - spinner-image: url("resource:///org/gnome/shell/theme/process-working.svg"); - spacing: 4px; } - #appMenu .label-shadow { - color: transparent; } - -.aggregate-menu { - min-width: 21em; } - .aggregate-menu .popup-menu-icon { - padding: 0 4px; } - -.system-menu-action { - color: #2e3436; - border-radius: 32px; - /* wish we could do 50% */ - padding: 13px; - border: 1px solid #adadad; } - .system-menu-action:hover, .system-menu-action:focus { - background-color: rgba(46, 52, 54, 0.1); - color: #2e3436; - border: none; - padding: 14px; } - .system-menu-action:active { - background-color: #4a90d9; - color: #ffffff; } - .system-menu-action > StIcon { - icon-size: 16px; } - -.ripple-box { - width: 52px; - height: 52px; - background-image: url("resource:///org/gnome/shell/theme/corner-ripple-ltr.png"); - background-size: contain; } - -.ripple-box:rtl { - background-image: url("resource:///org/gnome/shell/theme/corner-ripple-rtl.png"); } - -.popup-menu-arrow { - width: 16px; - height: 16px; } - -.popup-menu-icon { - icon-size: 1.09em; } - -.window-close { - background-image: url("resource:///org/gnome/shell/theme/close-window.svg"); - background-size: 32px; - height: 32px; - width: 32px; - -shell-close-overlap: 16px; } - .window-close:hover { - background-image: url("resource:///org/gnome/shell/theme/close-window-hover.svg"); } - .window-close:active { - background-image: url("resource:///org/gnome/shell/theme/close-window-active.svg"); } - -/* NETWORK DIALOGS */ -.nm-dialog { - max-height: 34em; - min-height: 31em; - min-width: 32em; } - -.nm-dialog-content { - spacing: 20px; - padding: 24px; } - -.nm-dialog-header-hbox { - spacing: 10px; } - -.nm-dialog-airplane-box { - spacing: 12px; } - -.nm-dialog-airplane-headline { - font-weight: bold; - text-align: center; } - -.nm-dialog-airplane-text { - color: #2e3436; } - -.nm-dialog-header-icon { - icon-size: 32px; } - -.nm-dialog-scroll-view { - border: 2px solid #a1a1a1; } - -.nm-dialog-header { - font-weight: bold; } - -.nm-dialog-item { - font-size: 110%; - border-bottom: 1px solid #a1a1a1; - padding: 12px; - spacing: 20px; } - -.nm-dialog-item:selected { - background-color: #4a90d9; - color: #ffffff; } - -.nm-dialog-icons { - spacing: .5em; } - -.nm-dialog-icon { - icon-size: 16px; } - -.no-networks-label { - color: #999999; } - -.no-networks-box { - spacing: 12px; } - -/* OVERVIEW */ -#overview { - spacing: 24px; } - -.overview-controls { - padding-bottom: 32px; } - -.window-picker { - -horizontal-spacing: 16px; - -vertical-spacing: 16px; - padding: 0 16px 16px; } - .window-picker.external-monitor { - padding: 16px; } - -.window-clone-border { - border: 4px solid #4a90d9; - border-radius: 4px; - box-shadow: inset 0px 0px 0px 1px #4a90d9; } - -.window-caption { - spacing: 25px; - color: #ffffff; - background-color: #4a90d9; - border-radius: 8px; - padding: 4px 12px; } - -.search-entry { - width: 320px; - padding: 7px 9px; - border-radius: 6px; - border-color: #747467; - color: #eeeeec; - background-color: #2e3436; } - .search-entry:focus { - padding: 6px 8px; - border-width: 2px; - border-color: #4a90d9; } - .search-entry .search-entry-icon { - icon-size: 1em; - padding: 0 4px; - color: rgba(46, 52, 54, 0.7); } - .search-entry:hover .search-entry-icon, .search-entry:focus .search-entry-icon { - color: #2e3436; } - -#searchResultsBin { - max-width: 1000px; } - -#searchResultsContent { - padding-left: 20px; - padding-right: 20px; - spacing: 16px; } - -.search-section { - spacing: 16px; } - -.search-section-content { - spacing: 32px; } - -.list-search-results { - spacing: 3px; } - -.search-section-separator { - height: 2px; - background-color: rgba(255, 255, 255, 0.2); } - -.list-search-result-content { - spacing: 30px; } - -.list-search-result-title { - color: #e2e2df; - spacing: 12px; } - -.list-search-result-description { - color: rgba(202, 202, 196, 0.5); } - -.list-search-provider-details { - width: 150px; - color: #e2e2df; - margin-top: 0.24em; } - -.list-search-provider-content { - spacing: 20px; } - -.search-provider-icon { - padding: 15px; } - -/* DASHBOARD */ -#dash { - font-size: 9pt; - color: #eeeeec; - background-color: #2e3436; - padding: 4px 0; - border: 1px solid rgba(128, 128, 128, 0.4); - border-left: 0px; - border-radius: 0px 9px 9px 0px; } - #dash:rtl { - border-radius: 9px 0 0 9px; } - #dash .placeholder { - background-image: url("resource:///org/gnome/shell/theme/dash-placeholder.svg"); - background-size: contain; - height: 24px; } - #dash .empty-dash-drop-target { - width: 24px; - height: 24px; } - -.dash-item-container > StWidget { - padding: 4px 8px; } - -.dash-label { - border-radius: 7px; - padding: 4px 12px; - color: #eeeeec; - background-color: rgba(46, 52, 54, 0.7); - text-align: center; - -x-offset: 8px; } - -/* App Vault/Grid */ -.icon-grid { - spacing: 30px; - -shell-grid-horizontal-item-size: 136px; - -shell-grid-vertical-item-size: 136px; } - .icon-grid .overview-icon { - icon-size: 96px; } - -.system-action-icon { - background-color: black; - color: white; - border-radius: 99px; - icon-size: 48px; } - -.app-view-controls { - padding-bottom: 32px; } - -.app-view-control { - padding: 4px 32px; } - .app-view-control:checked { - color: white; - border-color: rgba(0, 0, 0, 0.7); - background-color: #222728; - box-shadow: inset 0 0 black; - text-shadow: none; - icon-shadow: none; } - .app-view-control:first-child { - border-right-width: 0; - border-radius: 3px 0 0 3px; } - .app-view-control:last-child { - border-radius: 0 3px 3px 0; } - -.search-provider-icon:active, .search-provider-icon:checked, -.list-search-result:active, -.list-search-result:checked { - background-color: rgba(23, 25, 26, 0.9); } - -.search-provider-icon:focus, .search-provider-icon:selected, .search-provider-icon:hover, -.list-search-result:focus, -.list-search-result:selected, -.list-search-result:hover { - background-color: rgba(238, 238, 236, 0.1); - transition-duration: 200ms; } - -.app-well-app:active .overview-icon, -.app-well-app:checked .overview-icon, -.app-well-app.app-folder:active .overview-icon, -.app-well-app.app-folder:checked .overview-icon, -.show-apps:active .overview-icon, -.show-apps:checked .overview-icon, -.grid-search-result:active .overview-icon, -.grid-search-result:checked .overview-icon { - background-color: rgba(23, 25, 26, 0.9); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7); } - -.app-well-app:hover .overview-icon, -.app-well-app:focus .overview-icon, -.app-well-app:selected .overview-icon, -.app-well-app.app-folder:hover .overview-icon, -.app-well-app.app-folder:focus .overview-icon, -.app-well-app.app-folder:selected .overview-icon, -.show-apps:hover .overview-icon, -.show-apps:focus .overview-icon, -.show-apps:selected .overview-icon, -.grid-search-result:hover .overview-icon, -.grid-search-result:focus .overview-icon, -.grid-search-result:selected .overview-icon { - background-color: rgba(238, 238, 236, 0.1); - transition-duration: 0ms; - border-image: none; - background-image: none; } - -.app-well-app-running-dot { - width: 10px; - height: 3px; - background-color: #4a90d9; - margin-bottom: 2px; } - -.search-provider-icon, -.list-search-result, .app-well-app .overview-icon, -.app-well-app.app-folder .overview-icon, -.show-apps .overview-icon, -.grid-search-result .overview-icon { - color: #eeeeec; - border-radius: 4px; - padding: 6px; - border: 1px solid transparent; - transition-duration: 100ms; - text-align: center; } - -.app-well-app.app-folder > .overview-icon { - background-color: rgba(46, 52, 54, 0.4); } - -.show-apps:checked .show-apps-icon, -.show-apps:focus .show-apps-icon { - color: white; - transition-duration: 100ms; } - -.app-folder-popup { - -arrow-border-radius: 8px; - -arrow-background-color: rgba(46, 52, 54, 0.3); - -arrow-base: 24px; - -arrow-rise: 11px; } - -.app-folder-popup-bin { - padding: 5px; } - -.app-folder-icon { - padding: 5px; - spacing-rows: 5px; - spacing-columns: 5px; } - -.page-indicator { - padding: 15px 20px; } - .page-indicator .page-indicator-icon { - width: 18px; - height: 18px; - background-image: url(resource:///org/gnome/shell/theme/page-indicator-inactive.svg); } - .page-indicator:hover .page-indicator-icon { - background-image: url(resource:///org/gnome/shell/theme/page-indicator-hover.svg); } - .page-indicator:active .page-indicator-icon { - background-image: url(resource:///org/gnome/shell/theme/page-indicator-active.svg); } - .page-indicator:checked .page-indicator-icon, .page-indicator:checked:active { - background-image: url(resource:///org/gnome/shell/theme/page-indicator-checked.svg); } - -.app-well-app > .overview-icon.overview-icon-with-label, -.grid-search-result .overview-icon.overview-icon-with-label { - padding: 10px 8px 5px 8px; - spacing: 4px; } - -.workspace-thumbnails { - visible-width: 32px; - spacing: 11px; - padding: 8px; - border-radius: 9px 0 0 9px; } - .workspace-thumbnails:rtl { - border-radius: 0 9px 9px 0; } - -.workspace-thumbnail-indicator { - border: 4px solid #4a90d9; - padding: 1px; } - -.search-display > StBoxLayout, -.all-apps, -.frequent-apps > StBoxLayout { - padding: 0px 88px 10px 88px; } - -.workspace-thumbnails { - color: #eeeeec; - background-color: #2e3436; - border: 1px solid rgba(238, 238, 236, 0.2); } - -.search-statustext, .no-frequent-applications-label { - font-size: 2em; - font-weight: bold; - color: #2e3436; } - -/* NOTIFICATIONS & MESSAGE TRAY */ -.url-highlighter { - link-color: #74aae2; } - -.notification-banner { - font-size: 11pt; - width: 34em; - margin: 5px; - border-radius: 6px; - color: #eeeeec; - background-color: #2e3436; - border: 1px solid #a1a1a1; } - .notification-banner:hover { - background-color: #2e3436; } - .notification-banner:focus { - background-color: #2e3436; } - .notification-banner .notification-icon { - padding: 5px; } - .notification-banner .notification-content { - padding: 5px; - spacing: 5px; } - .notification-banner .secondary-icon { - icon-size: 1.09em; } - .notification-banner .notification-actions { - background-color: #a1a1a1; - padding-top: 2px; - spacing: 1px; } - .notification-banner .notification-button { - padding: 4px 4px 5px; - background-color: #222728; } - .notification-banner .notification-button:first-child { - border-radius: 0 0 0 6px; } - .notification-banner .notification-button:last-child { - border-radius: 0 0 6px 0; } - .notification-banner .notification-button:hover, .notification-banner .notification-buttonfocus { - background-color: #292f30; } - -.summary-source-counter { - font-size: 10pt; - font-weight: bold; - height: 1.6em; - width: 1.6em; - -shell-counter-overlap-x: 3px; - -shell-counter-overlap-y: 3px; - background-color: #4a90d9; - color: #ffffff; - border: 2px solid #eeeeec; - box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5); - border-radius: 0.9em; } - -.secondary-icon { - icon-size: 1.09em; } - -.chat-body { - spacing: 5px; } - -.chat-response { - margin: 5px; } - -.chat-log-message { - color: #17191a; } - -.chat-new-group { - padding-top: 1em; } - -.chat-received { - padding-left: 4px; } - .chat-received:rtl { - padding-left: 0px; - padding-right: 4px; } - -.chat-sent { - padding-left: 18pt; - color: #0b0c0d; } - .chat-sent:rtl { - padding-left: 0; - padding-right: 18pt; } - -.chat-meta-message { - padding-left: 4px; - font-size: 9pt; - font-weight: bold; - color: black; } - .chat-meta-message:rtl { - padding-left: 0; - padding-right: 4px; } - -.hotplug-transient-box { - spacing: 6px; - padding: 2px 72px 2px 12px; } - -.hotplug-notification-item { - padding: 2px 10px; } - .hotplug-notification-item:focus { - padding: 1px 71px 1px 11px; } - -.hotplug-notification-item-icon { - icon-size: 24px; - padding: 2px 5px; } - -.hotplug-resident-box { - spacing: 8px; } - -.hotplug-resident-mount { - spacing: 8px; - border-radius: 4px; } - .hotplug-resident-mount:hover { - background-color: rgba(237, 237, 237, 0.3); } - -.hotplug-resident-mount-label { - color: inherit; - padding-left: 6px; } - -.hotplug-resident-mount-icon { - icon-size: 24px; - padding-left: 6px; } - -.hotplug-resident-eject-icon { - icon-size: 16px; } - -.hotplug-resident-eject-button { - padding: 7px; - border-radius: 5px; - color: pink; } - -/* Eeeky things */ -.magnifier-zoom-region { - border: 2px solid #4a90d9; } - .magnifier-zoom-region.full-screen { - border-width: 0; } - -/* On-screen Keyboard */ -#keyboard { - background-color: rgba(46, 52, 54, 0.7); } - -.keyboard-layout { - spacing: 10px; - padding: 10px; } - -.keyboard-row { - spacing: 15px; } - -.keyboard-key { - color: #eeeeec; - background-color: #2e3436; - border-color: rgba(0, 0, 0, 0.7); - box-shadow: inset 0 1px #454f52; - text-shadow: 0 1px black; - icon-shadow: 0 1px black; - min-height: 2em; - min-width: 2em; - font-size: 14pt; - font-weight: bold; - border-radius: 5px; - border: 1px solid #a1a1a1; - color: white; } - .keyboard-key:focus { - color: #eeeeec; - text-shadow: 0 1px black; - icon-shadow: 0 1px black; - box-shadow: inset 0px 0px 0px 1px #4a90d9; } - .keyboard-key:hover, .keyboard-key:checked { - color: white; - border-color: rgba(0, 0, 0, 0.7); - background-color: #454f52; - box-shadow: inset 0 1px #5d696d; - text-shadow: 0 1px black; - icon-shadow: 0 1px black; } - .keyboard-key:active { - color: white; - border-color: rgba(0, 0, 0, 0.7); - background-color: #222728; - box-shadow: inset 0 0 black; - text-shadow: none; - icon-shadow: none; } - .keyboard-key:grayed { - background-color: #2e3436; - color: #eeeeec; - border-color: rgba(0, 0, 0, 0.7); } - -.keyboard-subkeys { - color: white; - padding: 5px; - -arrow-border-radius: 10px; - -arrow-background-color: rgba(46, 52, 54, 0.7); - -arrow-border-width: 2px; - -arrow-border-color: rgba(238, 238, 236, 0.2); - -arrow-base: 20px; - -arrow-rise: 10px; - -boxpointer-gap: 5px; } - -.candidate-popup-content { - padding: 0.5em; - spacing: 0.3em; } - -.candidate-index { - padding: 0 0.5em 0 0; - color: #17191a; } - -.candidate-box { - padding: 0.3em 0.5em 0.3em 0.5em; - border-radius: 4px; } - .candidate-box:selected, .candidate-box:hover { - background-color: #4a90d9; - color: #ffffff; } - -.candidate-page-button-box { - height: 2em; } - .vertical .candidate-page-button-box { - padding-top: 0.5em; } - .horizontal .candidate-page-button-box { - padding-left: 0.5em; } - -.candidate-page-button { - padding: 4px; } - -.candidate-page-button-previous { - border-radius: 4px 0px 0px 4px; - border-right-width: 0; } - -.candidate-page-button-next { - border-radius: 0px 4px 4px 0px; } - -.candidate-page-button-icon { - icon-size: 1em; } - -/* Auth Dialogs & Screen Shield */ -.framed-user-icon { - background-size: contain; - border: 2px solid #eeeeec; - color: #eeeeec; - border-radius: 3px; } - .framed-user-icon:hover { - border-color: white; - color: white; } - -.login-dialog-banner-view { - padding-top: 24px; - max-width: 23em; } - -.login-dialog { - border: none; - background-color: transparent; } - .login-dialog .modal-dialog-button-box { - spacing: 3px; } - .login-dialog .modal-dialog-button { - padding: 3px 18px; } - .login-dialog .modal-dialog-button:default { - color: #eeeeec; - background-color: rgba(74, 144, 217, 0.5); - border-color: rgba(0, 0, 0, 0.7); - box-shadow: inset 0 1px #454f52; - text-shadow: 0 1px black; - icon-shadow: 0 1px black; } - .login-dialog .modal-dialog-button:default:hover, .login-dialog .modal-dialog-button:default:focus { - color: white; - border-color: rgba(0, 0, 0, 0.7); - background-color: rgba(74, 144, 217, 0.7); - box-shadow: inset 0 1px #5d696d; - text-shadow: 0 1px black; - icon-shadow: 0 1px black; } - .login-dialog .modal-dialog-button:default:active { - color: white; - border-color: rgba(0, 0, 0, 0.7); - background-color: #3583d5; - box-shadow: inset 0 0 black; - text-shadow: none; - icon-shadow: none; } - .login-dialog .modal-dialog-button:default:insensitive { - color: #8e9192; - border-color: rgba(0, 0, 0, 0.7); - background-color: rgba(65, 71, 72, 0.7); - box-shadow: none; - text-shadow: none; - icon-shadow: none; } - -.login-dialog-logo-bin { - padding: 24px 0px; } - -.login-dialog-banner { - color: #d6d6d1; } - -.login-dialog-button-box { - spacing: 5px; } - -.login-dialog-message-warning { - color: #f57900; } - -.login-dialog-message-hint { - padding-top: 0; - padding-bottom: 20px; } - -.login-dialog-user-selection-box { - padding: 100px 0px; } - -.login-dialog-not-listed-label { - padding-left: 2px; } - .login-dialog-not-listed-button:focus .login-dialog-not-listed-label, - .login-dialog-not-listed-button:hover .login-dialog-not-listed-label { - color: #eeeeec; } - -.login-dialog-not-listed-label { - font-size: 90%; - font-weight: bold; - color: #a6a69b; - padding-top: 1em; } - -.login-dialog-user-list-view { - -st-vfade-offset: 1em; } - -.login-dialog-user-list { - spacing: 12px; - padding: .2em; - width: 23em; } - .login-dialog-user-list:expanded .login-dialog-user-list-item:selected { - background-color: #4a90d9; - color: #ffffff; } - .login-dialog-user-list:expanded .login-dialog-user-list-item:logged-in { - border-right: 2px solid #4a90d9; } - -.login-dialog-user-list-item { - border-radius: 5px; - padding: .2em; - color: #a6a69b; } - .login-dialog-user-list-item:ltr { - padding-right: 1em; } - .login-dialog-user-list-item:rtl { - padding-left: 1em; } - .login-dialog-user-list-item .login-dialog-timed-login-indicator { - height: 2px; - margin: 2px 0 0 0; - background-color: #eeeeec; } - .login-dialog-user-list-item:focus .login-dialog-timed-login-indicator { - background-color: #ffffff; } - -.login-dialog-username, -.user-widget-label { - color: #eeeeec; - font-size: 120%; - font-weight: bold; - text-align: left; - padding-left: 15px; } - -.user-widget-label:ltr { - padding-left: 18px; } - -.user-widget-label:rtl { - padding-right: 18px; } - -.login-dialog-prompt-layout { - padding-top: 24px; - padding-bottom: 12px; - spacing: 8px; - width: 23em; } - -.login-dialog-prompt-label { - color: #bebeb6; - font-size: 110%; - padding-top: 1em; } - -.login-dialog-session-list-button StIcon { - icon-size: 1.25em; } - -.login-dialog-session-list-button { - color: #a6a69b; } - .login-dialog-session-list-button:hover, .login-dialog-session-list-button:focus { - color: #eeeeec; } - .login-dialog-session-list-button:active { - color: #747467; } - -.screen-shield-arrows { - padding-bottom: 3em; } - -.screen-shield-arrows Gjs_Arrow { - color: white; - width: 80px; - height: 48px; - -arrow-thickness: 12px; - -arrow-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); } - -.screen-shield-clock { - color: white; - text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.6); - font-weight: bold; - text-align: center; - padding-bottom: 1.5em; } - -.screen-shield-clock-time { - font-size: 72pt; - text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.4); } - -.screen-shield-clock-date { - font-size: 28pt; } - -.screen-shield-notifications-container { - spacing: 6px; - width: 30em; - background-color: transparent; - max-height: 500px; } - .screen-shield-notifications-container .summary-notification-stack-scrollview { - padding-top: 0; - padding-bottom: 0; } - .screen-shield-notifications-container .notification, - .screen-shield-notifications-container .screen-shield-notification-source { - padding: 12px 6px; - border: 1px solid rgba(238, 238, 236, 0.2); - background-color: rgba(46, 52, 54, 0.5); - color: #eeeeec; - border-radius: 4px; } - .screen-shield-notifications-container .notification { - margin-right: 15px; } - -.screen-shield-notification-label { - font-weight: bold; - padding: 0px 0px 0px 12px; } - -.screen-shield-notification-count-text { - padding: 0px 0px 0px 12px; } - -#panel.lock-screen { - background-color: rgba(46, 52, 54, 0.5); } - -.screen-shield-background { - background: black; - box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4); } - -#lockDialogGroup { - background: #2e3436 url(resource:///org/gnome/shell/theme/noise-texture.png); - background-repeat: repeat; } - -#screenShieldNotifications StButton#vhandle, #screenShieldNotifications StButton#hhandle { - background-color: rgba(237, 237, 237, 0.3); } - #screenShieldNotifications StButton#vhandle:hover, #screenShieldNotifications StButton#vhandle:focus, #screenShieldNotifications StButton#hhandle:hover, #screenShieldNotifications StButton#hhandle:focus { - background-color: rgba(237, 237, 237, 0.5); } - #screenShieldNotifications StButton#vhandle:active, #screenShieldNotifications StButton#hhandle:active { - background-color: rgba(74, 144, 217, 0.5); } - -#LookingGlassDialog { - background-color: rgba(0, 0, 0, 0.8); - spacing: 4px; - padding: 4px; - border: 2px solid grey; - border-radius: 4px; } - #LookingGlassDialog > #Toolbar { - border: 1px solid grey; - border-radius: 4px; } - #LookingGlassDialog .labels { - spacing: 4px; } - #LookingGlassDialog .notebook-tab { - -natural-hpadding: 12px; - -minimum-hpadding: 6px; - font-weight: bold; - color: #ccc; - transition-duration: 100ms; - padding-left: .3em; - padding-right: .3em; } - #LookingGlassDialog .notebook-tab:hover { - color: white; - text-shadow: black 0px 2px 2px; } - #LookingGlassDialog .notebook-tab:selected { - border-bottom-width: 2px; - border-color: #5f9ddd; - color: white; - text-shadow: black 0px 2px 2px; } - #LookingGlassDialog StBoxLayout#EvalBox { - padding: 4px; - spacing: 4px; } - #LookingGlassDialog StBoxLayout#ResultsArea { - spacing: 4px; } - -.lg-dialog StEntry { - selection-background-color: #bbbbbb; - selected-color: #333333; } - -.lg-dialog .shell-link { - color: #999999; } - .lg-dialog .shell-link:hover { - color: #dddddd; } - -.lg-completions-text { - font-size: .9em; - font-style: italic; } - -.lg-obj-inspector-title { - spacing: 4px; } - -.lg-obj-inspector-button { - border: 1px solid gray; - padding: 4px; - border-radius: 4px; } - .lg-obj-inspector-button:hover { - border: 1px solid #ffffff; } - -#lookingGlassExtensions { - padding: 4px; } - -.lg-extensions-list { - padding: 4px; - spacing: 6px; } - -.lg-extension { - border: 1px solid #6f6f6f; - border-radius: 4px; - padding: 4px; } - -.lg-extension-name { - font-weight: bold; } - -.lg-extension-meta { - spacing: 6px; } - -#LookingGlassPropertyInspector { - background: rgba(0, 0, 0, 0.8); - border: 2px solid grey; - border-radius: 4px; - padding: 6px; } - -/* Overrides */ -#panel, #panel.solid { - font-weight: normal; - background-color: #ededed; - background-gradient-direction: vertical; - background-gradient-end: #e0e0e0; - border-top-color: #666; - /* we don't support non-uniform border-colors and - use the top border color for any border, so we - need to set it even if all we want is a bottom - border */ - border-bottom: 1px solid #666; - app-icon-bottom-clip: 0px; } - #panel:overview, #panel.solid:overview { - background-color: #000; - background-gradient-end: #000; - border-top-color: #000; - border-bottom: 1px solid #000; } - #panel:overview .panel-button, #panel.solid:overview .panel-button { - color: #fff; } - #panel .panel-button, #panel.solid .panel-button { - -natural-hpadding: 8px; - -minimum-hpadding: 4px; - font-weight: normal; - color: #2e3436; - text-shadow: none; } - #panel .panel-button:active, #panel .panel-button:overview, #panel .panel-button:focus, #panel .panel-button:checked, #panel.solid .panel-button:active, #panel.solid .panel-button:overview, #panel.solid .panel-button:focus, #panel.solid .panel-button:checked { - background-color: #4a90d9 !important; - color: #ffffff !important; - box-shadow: none; } - #panel .panel-button:active > .system-status-icon, #panel .panel-button:overview > .system-status-icon, #panel .panel-button:focus > .system-status-icon, #panel .panel-button:checked > .system-status-icon, #panel.solid .panel-button:active > .system-status-icon, #panel.solid .panel-button:overview > .system-status-icon, #panel.solid .panel-button:focus > .system-status-icon, #panel.solid .panel-button:checked > .system-status-icon { - icon-shadow: none; } - #panel .panel-button:hover, #panel.solid .panel-button:hover { - text-shadow: none; } - #panel .panel-button:hover .system-status-icon, #panel.solid .panel-button:hover .system-status-icon { - icon-shadow: none; } - #panel .panel-button .app-menu-icon, #panel.solid .panel-button .app-menu-icon { - width: 0; - height: 0; - margin: 0; } - #panel .panel-button .system-status-icon, #panel.solid .panel-button .system-status-icon { - icon-shadow: none; } - #panel .panel-corner, - #panel .panel-corner:active, - #panel .panel-corner:overview, - #panel .panel-corner:focus, #panel.solid .panel-corner, - #panel.solid .panel-corner:active, - #panel.solid .panel-corner:overview, - #panel.solid .panel-corner:focus { - -panel-corner-radius: 0; } - #panel.lock-screen, #panel.unlock-screen, #panel.login-screen, #panel.solid.lock-screen, #panel.solid.unlock-screen, #panel.solid.login-screen { - background-color: rgba(46, 52, 54, 0.5); - background-gradient-start: rgba(46, 52, 54, 0.5); - background-gradient-end: rgba(46, 52, 54, 0.5); - border-bottom: none; } - #panel.lock-screen .panel-button, #panel.unlock-screen .panel-button, #panel.login-screen .panel-button, #panel.solid.lock-screen .panel-button, #panel.solid.unlock-screen .panel-button, #panel.solid.login-screen .panel-button { - color: #eeeeec; } - #panel .popup-menu-arrow, #panel.solid .popup-menu-arrow { - width: 0; - height: 0; } - -#appMenu { - padding: 0 8px 0 8px; - spinner-image: url("classic-process-working.svg"); } - -.tile-preview-left.on-primary, -.tile-preview-right.on-primary, -.tile-preview-left.tile-preview-right.on-primary { - /* keep in sync with -panel-corner-radius */ - border-radius: 0; } - -.toggle-switch-us { - background-image: url("classic-toggle-off-us.svg"); } - .toggle-switch-us:checked { - background-image: url("classic-toggle-on-us.svg"); } - -.toggle-switch-intl { - background-image: url("classic-toggle-off-intl.svg"); } - .toggle-switch-intl:checked { - background-image: url("classic-toggle-on-intl.svg"); } - -.calendar-day-with-events { - background-image: url("calendar-today.svg"); } - -.message-list-clear-button.button { - color: #2e3436; } - -.notification-banner { - background-color: #ededed !important; - color: #2e3436; } - .notification-banner .notification-button { - background-color: #e0e0e0; } - .notification-banner .notification-button:hover, .notification-banner .notification-buttonfocus { - background-color: #e8e8e8; } diff --git a/data/meson.build b/data/meson.build index c1fbece6..4118d6e5 100644 --- a/data/meson.build +++ b/data/meson.build @@ -43,22 +43,18 @@ theme_data = [ 'classic-toggle-off-us.svg', 'classic-toggle-on-intl.svg', 'classic-toggle-on-us.svg', - 'gnome-classic.css', 'gnome-classic-high-contrast.css' ] -update_theme = files('update-theme.sh') - -if sassc.found() - style = 'gnome-classic' - custom_target(style + '.css', - input: style + '.scss', - output: style + '.css', - depend_files: theme_sources + files(style + '.css'), - command: [update_theme, '@INPUT@', '@OUTPUT@'], - build_by_default: true - ) -endif +style = 'gnome-classic' +custom_target(style + '.css', + input: style + '.scss', + output: style + '.css', + depend_files: theme_sources, + command: [sassc, '-a', '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: themedir +) install_data(theme_data, install_dir: themedir) diff --git a/data/update-theme.sh b/data/update-theme.sh deleted file mode 100755 index f8d2a0d5..00000000 --- a/data/update-theme.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -INPUT=$1 -OUTPUT=$2 - -if [ `which sassc` ] -then - sassc -a $INPUT | tee ${INPUT%%.scss}.css > $OUTPUT -fi diff --git a/meson.build b/meson.build index 23a0cfc0..05a3a44a 100644 --- a/meson.build +++ b/meson.build @@ -23,7 +23,6 @@ xsessiondir = join_paths(datadir, 'xsession') extensionlib = files('lib/convenience.js') js52 = find_program('js52', required: false) -sassc = find_program('sassc', required: false) ver_arr = meson.project_version().split('.') if ver_arr[1].to_int().is_even() @@ -92,6 +91,7 @@ foreach e : enabled_extensions endforeach if classic_mode_enabled + sassc = find_program('sassc', required: true) subdir('data') endif From a808380d04077b4585a22bce45464040d196457d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 22 Feb 2018 13:35:58 +0100 Subject: [PATCH 59/60] Update sass submodule --- data/gnome-shell-sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/gnome-shell-sass b/data/gnome-shell-sass index 336c2d5a..10a8ef19 160000 --- a/data/gnome-shell-sass +++ b/data/gnome-shell-sass @@ -1 +1 @@ -Subproject commit 336c2d5ad6b165f586330ec7e1fdc23ff220638a +Subproject commit 10a8ef19861802e2a16d198980600aa97d687054 From 45ac2cd4036bb1727e21d93a52777a7c545abb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 22 Feb 2018 12:49:41 +0100 Subject: [PATCH 60/60] Bump version to 3.27.91 Update NEWS. --- NEWS | 19 +++++++++++++++++++ meson.build | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 2dfe30e1..f20ad927 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,22 @@ +3.27.91 +======= +* places-menu: Support unmounting ejectable places [Rémy; #17] +* apps-menu: Support separators and custom sort order [Florian; #27] +* Port to meson [Florian; #31, #45] +* window-list: Fix missing icons on wayland [Florian; #10] +* places-menu: Fix terminating gnome-shell with recent gjs [Florian; #44] +* auto-move: Make it work with wayland windows [Florian; #33] +* Classic theme fixes [Florian, Jonas; #26, #41, #39, #40] +* Require sassc for classic styling [Florian; !28] +* Misc. bug fixes [Piotr, Florian; #772211, #32, #30] + +Contributors: + Jeremy Bicha, Piotr Drąg, Jonas Kümmerlin, Rémy Lefevre, Iñigo Martínez, + Florian Müllner + +Translators: + Matej Urbančič [sl], Kjartan Maraas [nb] + 3.27.1 ====== * updated translations (ca@valencia) diff --git a/meson.build b/meson.build index 05a3a44a..a87e9812 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gnome-shell-extensions', - version: '3.27.1', + version: '3.27.91', meson_version: '>= 0.44.0', license: 'GPL2+' )