From c0454db0c6c027f6b58b69a82965d2be1fea2986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 23 Sep 2018 16:34:06 +0200 Subject: [PATCH 1/5] appsMenu: Consider scale-factor in height computation Actor heights are in physical pixels, while CSS measures are in logical pixels, so we need to adjust accordingly to prevent the scale factor from being applied twice. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/102 --- extensions/apps-menu/extension.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index deb6cc3e..a4aa8524 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -685,7 +685,10 @@ class ApplicationsButton extends PanelMenu.Button { //Load applications this._displayButtons(this._listApplications(null)); - let height = this.categoriesBox.height + MENU_HEIGHT_OFFSET + 'px'; + let themeContext = St.ThemeContext.get_for_stage(global.stage); + let scaleFactor = themeContext.scale_factor; + let categoriesHeight = this.categoriesBox.height / scaleFactor; + let height = Math.round(categoriesHeight) + MENU_HEIGHT_OFFSET + 'px'; this.mainBox.style+=('height: ' + height); } From d424b0f645366b75a945f1bbc6678e7dd735df39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 6 Oct 2018 17:43:23 +0200 Subject: [PATCH 2/5] window-list: Minor clean-up Modern javascript has explicit methods for locating the first element of an array that meets a certain condition, use those instead of manually looping over the array. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/78 --- extensions/window-list/extension.js | 37 +++++++++-------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 8257eac8..dd165afd 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -899,16 +899,9 @@ class WindowList { return; 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) { - active = i; - break; - } - } - - active = Math.max(0, Math.min(active + diff, children.length-1)); - children[active].activate(); + let active = children.findIndex(c => c.active); + let newActive = Math.max(0, Math.min(active + diff, children.length-1)); + children[newActive].activate(); } _updatePosition() { @@ -1023,12 +1016,9 @@ class WindowList { _removeApp(app) { let children = this._windowList.get_children(); - for (let i = 0; i < children.length; i++) { - if (children[i]._delegate.app == app) { - children[i].destroy(); - return; - } - } + let child = children.find(c => c._delegate.app == app); + if (child) + child.destroy(); } _onWindowAdded(ws, win) { @@ -1042,10 +1032,8 @@ class WindowList { return; let children = this._windowList.get_children(); - for (let i = 0; i < children.length; i++) { - if (children[i]._delegate.metaWindow == win) - return; - } + if (children.find(c => c._delegate.metaWindow == win)) + return; let button = new WindowButton(win, this._perMonitor, this._monitor.index); this._windowList.layout_manager.pack(button.actor, @@ -1065,12 +1053,9 @@ class WindowList { return; // not actually removed, just moved to another workspace let children = this._windowList.get_children(); - for (let i = 0; i < children.length; i++) { - if (children[i]._delegate.metaWindow == win) { - children[i].destroy(); - return; - } - } + let child = children.find(c => c._delegate.metaWindow == win); + if (child) + child.destroy(); } _onWorkspacesChanged() { From 9410bdfad6744fa8dbedf49b15dee3c3e34fb1c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 6 Oct 2018 17:44:59 +0200 Subject: [PATCH 3/5] window-list: Ignore hidden buttons when scrolling Window lists are per-monitor, so workspaces are implemented by simply hiding all buttons that correspond to windows/apps on other workspaces. That means we need to take the visibility into account when handling scroll-events to switch through the list, or else we'll end up switching "randomly" between workspaces. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/78 --- extensions/window-list/extension.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index dd165afd..b8ab37b5 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -898,7 +898,9 @@ class WindowList { else return; - let children = this._windowList.get_children().map(a => a._delegate); + let children = this._windowList.get_children() + .filter(c => c.visible) + .map(a => a._delegate); let active = children.findIndex(c => c.active); let newActive = Math.max(0, Math.min(active + diff, children.length-1)); children[newActive].activate(); From d34933de0b58c7dc70ebf8e2045c003acb98a912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 8 Oct 2018 22:50:52 +0200 Subject: [PATCH 4/5] 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 7d56794a..6687e7d3 160000 --- a/data/gnome-shell-sass +++ b/data/gnome-shell-sass @@ -1 +1 @@ -Subproject commit 7d56794aab6fff4fe80d11e516dcca2cae44a34d +Subproject commit 6687e7d3d419dda108d2d3c6f064f8c3b832f5ee From 94eba47358cfa521d34e8972e8503eca52dd5da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 8 Oct 2018 22:55:05 +0200 Subject: [PATCH 5/5] Bump version to 3.30.1 Update NEWS. --- NEWS | 9 +++++++++ meson.build | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 9654892c..33ac37e0 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +3.30.1 +====== +* apps-menu: Fix height on HiDPI systems [Florian; #102] +* window-list: Only switch between windows on active workspace when scrolling + [Florian; #78] + +Contributors: + Florian Müllner + 3.30.0 ====== * Bump version diff --git a/meson.build b/meson.build index ef836e0a..6b7654bb 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gnome-shell-extensions', - version: '3.30.0', + version: '3.30.1', meson_version: '>= 0.44.0', license: 'GPL2+' )