panel: Don't allow opening hidden menus via keybindings

We shouldn't allow toggling menus that aren't supported by the
current session mode, but as indicators are hidden rather than
destroyed on mode switches, it is not enough to check for an
indicator's existence.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/851
This commit is contained in:
Florian Müllner 2019-01-23 23:55:12 +01:00 committed by Ray Strode
parent f78efc46e7
commit c1a6effea0

View File

@ -957,8 +957,8 @@ class Panel extends St.Widget {
} }
_toggleMenu(indicator) { _toggleMenu(indicator) {
if (!indicator) // menu not supported by current session mode if (!indicator || !indicator.container.visible)
return; return; // menu not supported by current session mode
let menu = indicator.menu; let menu = indicator.menu;
if (!indicator.actor.reactive) if (!indicator.actor.reactive)