panel: Keep prefs in sync with shell-shows-app-menu state

Previously mutter listened to Xsettings (via GTK) to get notified
whether the shell showed the app menu. After X11 support was changed in
the direction of being less central, listening to this particular
Xsettings were removed with the intention of having the Shell tell
mutter directly whether it was showing the menu or not.

This commit makes that happen. It still travels through Xsettings (still
via Gtk), as the shell still gets that state from Xsettings, but fixing
this is out of scope for this particular fix.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/276
This commit is contained in:
Jonas Ådahl 2018-08-23 15:56:50 +02:00 committed by Florian Müllner
parent 461d2b1945
commit 900398406c

View File

@ -307,8 +307,11 @@ var AppMenuButton = new Lang.Class({
} }
} }
let shellShowsAppMenu = this._gtkSettings.gtk_shell_shows_app_menu;
Meta.prefs_set_show_fallback_app_menu(!shellShowsAppMenu);
let visible = (this._targetApp != null && let visible = (this._targetApp != null &&
this._gtkSettings.gtk_shell_shows_app_menu && shellShowsAppMenu &&
!Main.overview.visibleTarget); !Main.overview.visibleTarget);
if (visible) if (visible)
this.show(); this.show();