From a80336bebb15033026fc595103c766dce7d8dd0d Mon Sep 17 00:00:00 2001 From: fredcw Date: Mon, 7 Aug 2023 15:51:09 +0100 Subject: [PATCH] Menu applet: Fix bug where menu is partly behind panel (#11788) * Fix bug where menu is partly behind panel Call peekPanel() before toggling menu open to ensure menu is positioned correctly. * panel.js: Use better method to determine when panel is visible. this._shouldShow is set to false when mouse leaves auto-hide panel even if panel remains open due to an applet being open so use !this._hidden instead. --- .../usr/share/cinnamon/applets/menu@cinnamon.org/applet.js | 7 +++---- js/ui/panel.js | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/files/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js b/files/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js index b1aba06d9c..8c160817fd 100644 --- a/files/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js +++ b/files/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js @@ -1318,6 +1318,9 @@ class CinnamonMenuApplet extends Applet.TextIconApplet { _updateKeybinding() { Main.keybindingManager.addHotKey("overlay-key-" + this.instance_id, this.overlayKey, Lang.bind(this, function() { if (!Main.overview.visible && !Main.expo.visible) + if (this.forceShowPanel && !this.isOpen) { + this.panel.peekPanel(); + } this.menu.toggle_with_options(this.enableAnimation); })); } @@ -1495,10 +1498,6 @@ class CinnamonMenuApplet extends Applet.TextIconApplet { this._allAppsCategoryButton.actor.style_class = "menu-category-button-selected"; Mainloop.idle_add(Lang.bind(this, this._initial_cat_selection, n)); - - if (this.forceShowPanel) { - this.panel.peekPanel(); - } } else { this.actor.remove_style_pseudo_class('active'); if (this.searchActive) { diff --git a/js/ui/panel.js b/js/ui/panel.js index 11c736bec2..6f86ce2492 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -3845,7 +3845,7 @@ Panel.prototype = { }, getIsVisible: function() { - return this._shouldShow; + return !this._hidden; }, resetDNDZones: function() {