App menu: only create the popup menu with a GMenu
Since the application proxy is created asynchronously, at the time the GActionGroup (GActionMuxer) is created, there is no GDBusMenu yet. Defer creating the menu in that case. Also, clear out signal handlers if have no target application. https://bugzilla.gnome.org/show_bug.cgi?id=633028
This commit is contained in:
@ -528,6 +528,9 @@ const AppMenuButton = new Lang.Class({
|
||||
if (targetApp) {
|
||||
this._appMenuNotifyId = targetApp.connect('notify::menu', Lang.bind(this, this._sync));
|
||||
this._actionGroupNotifyId = targetApp.connect('notify::action-group', Lang.bind(this, this._sync));
|
||||
} else {
|
||||
this._appMenuNotifyId = 0;
|
||||
this._actionGroupNotifyId = 0;
|
||||
}
|
||||
|
||||
this._targetApp = targetApp;
|
||||
@ -549,7 +552,7 @@ const AppMenuButton = new Lang.Class({
|
||||
_maybeSetMenu: function() {
|
||||
let menu;
|
||||
|
||||
if (this._targetApp.action_group) {
|
||||
if (this._targetApp.action_group && this._targetApp.menu) {
|
||||
if (this.menu instanceof PopupMenu.RemoteMenu &&
|
||||
this.menu.actionGroup == this._targetApp.action_group)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user