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] 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); }