window-list: Only have a single context menu at any time
Depending on the number of windows, AppButtons use different right-click
menus ("Minimize" vs. "Minimize all").
As the menu for the multiple-windows case remains the same, it is created
and added just once. However this means that in the single-window case,
the corresponding PopupMenuManager will track two menus for the same
source actor, resulting in various misbehaviors.
Fix these issues by adding and removing the app context menu appropriately,
so that the PopupMenuManager tracks a single menu at any time.
https://bugzilla.gnome.org/show_bug.cgi?id=724688
This commit is contained in:
@@ -391,7 +391,6 @@ const AppButton = new Lang.Class({
|
||||
this._appContextMenu = new AppContextMenu(this.actor, this.app);
|
||||
this._appContextMenu.connect('open-state-changed', _onMenuStateChanged);
|
||||
this._appContextMenu.actor.hide();
|
||||
this._contextMenuManager.addMenu(this._appContextMenu);
|
||||
Main.uiGroup.add_actor(this._appContextMenu.actor);
|
||||
|
||||
this._textureCache = St.TextureCache.get_default();
|
||||
@@ -470,6 +469,7 @@ const AppButton = new Lang.Class({
|
||||
this._windowContextMenu.actor.hide();
|
||||
this._contextMenuManager.addMenu(this._windowContextMenu);
|
||||
}
|
||||
this._contextMenuManager.removeMenu(this._appContextMenu);
|
||||
this._contextMenu = this._windowContextMenu;
|
||||
} else {
|
||||
if (this._windowTitle) {
|
||||
@@ -480,6 +480,7 @@ const AppButton = new Lang.Class({
|
||||
this._windowContextMenu = null;
|
||||
}
|
||||
this._contextMenu = this._appContextMenu;
|
||||
this._contextMenuManager.addMenu(this._appContextMenu);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user