panel: Ignore shell-shows-app-menu setting

The GtkSettings was originally introduced to inform applications about
the desktop shell's capabilities, but users soon started to use it to
force GTK+ to show the app menu inside the application. We eventually
caved and also handled the setting ourselves to hide the in-shell app
menu to allow users to "move" it.

But now the remote app menu is in the process of being retired[0], and
will be replaced with a simple indicator that cannot be moved, so
stop following the GtkSetting.

[0] https://gitlab.gnome.org/GNOME/Initiatives/wikis/App-Menu-Retirement

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
This commit is contained in:
Florian Müllner 2018-10-04 16:52:34 +02:00
parent 9f61a4f5fd
commit c334aa2a4c

View File

@ -122,14 +122,11 @@ var AppMenuButton = GObject.registerClass({
this._arrow = PopupMenu.arrowIcon(St.Side.BOTTOM); this._arrow = PopupMenu.arrowIcon(St.Side.BOTTOM);
this._container.add_actor(this._arrow); this._container.add_actor(this._arrow);
this._visible = this._gtkSettings.gtk_shell_shows_app_menu && this._visible = !Main.overview.visible;
!Main.overview.visible;
if (!this._visible) if (!this._visible)
this.hide(); this.hide();
this._overviewHidingId = Main.overview.connect('hiding', this._sync.bind(this)); this._overviewHidingId = Main.overview.connect('hiding', this._sync.bind(this));
this._overviewShowingId = Main.overview.connect('showing', this._sync.bind(this)); this._overviewShowingId = Main.overview.connect('showing', this._sync.bind(this));
this._showsAppMenuId = this._gtkSettings.connect('notify::gtk-shell-shows-app-menu',
this._sync.bind(this));
this._stop = true; this._stop = true;
@ -305,12 +302,7 @@ var AppMenuButton = GObject.registerClass({
} }
} }
let shellShowsAppMenu = this._gtkSettings.gtk_shell_shows_app_menu; let visible = (this._targetApp != null && !Main.overview.visibleTarget);
Meta.prefs_set_show_fallback_app_menu(!shellShowsAppMenu);
let visible = (this._targetApp != null &&
shellShowsAppMenu &&
!Main.overview.visibleTarget);
if (visible) if (visible)
this.fadeIn(); this.fadeIn();
else else
@ -383,10 +375,6 @@ var AppMenuButton = GObject.registerClass({
Main.overview.disconnect(this._overviewShowingId); Main.overview.disconnect(this._overviewShowingId);
this._overviewShowingId = 0; this._overviewShowingId = 0;
} }
if (this._showsAppMenuId > 0) {
this._gtkSettings.disconnect(this._showsAppMenuId);
this._showsAppMenuId = 0;
}
if (this._switchWorkspaceNotifyId > 0) { if (this._switchWorkspaceNotifyId > 0) {
global.window_manager.disconnect(this._switchWorkspaceNotifyId); global.window_manager.disconnect(this._switchWorkspaceNotifyId);
this._switchWorkspaceNotifyId = 0; this._switchWorkspaceNotifyId = 0;