popupMenu: Make MenuManager to take an actor as parameter

Since we assume now that most of the classes are actors per se we can just pass
the actor itself as parameter

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/487
This commit is contained in:
Marco Trevisan (Treviño) 2019-04-09 18:23:59 -05:00 committed by Florian Müllner
parent 44fcb9e9af
commit 7bb84dae80
6 changed files with 6 additions and 6 deletions

View File

@ -325,7 +325,7 @@ var SessionMenuButton = class {
this._button.remove_style_pseudo_class('active'); this._button.remove_style_pseudo_class('active');
}); });
this._manager = new PopupMenu.PopupMenuManager({ actor: this._button }, this._manager = new PopupMenu.PopupMenuManager(this._button,
{ actionMode: Shell.ActionMode.NONE }); { actionMode: Shell.ActionMode.NONE });
this._manager.addMenu(this._menu); this._manager.addMenu(this._menu);

View File

@ -1479,7 +1479,7 @@ var AppIcon = class AppIcon {
this.actor.connect('popup-menu', this._onKeyboardPopupMenu.bind(this)); this.actor.connect('popup-menu', this._onKeyboardPopupMenu.bind(this));
this._menu = null; this._menu = null;
this._menuManager = new PopupMenu.PopupMenuManager(this); this._menuManager = new PopupMenu.PopupMenuManager(this.actor);
if (isDraggable) { if (isDraggable) {
this._draggable = DND.makeDraggable(this.actor); this._draggable = DND.makeDraggable(this.actor);

View File

@ -25,7 +25,7 @@ var BackgroundMenu = class BackgroundMenu extends PopupMenu.PopupMenu {
function addBackgroundMenu(actor, layoutManager) { function addBackgroundMenu(actor, layoutManager) {
actor.reactive = true; actor.reactive = true;
actor._backgroundMenu = new BackgroundMenu(layoutManager); actor._backgroundMenu = new BackgroundMenu(layoutManager);
actor._backgroundManager = new PopupMenu.PopupMenuManager({ actor: actor }); actor._backgroundManager = new PopupMenu.PopupMenuManager(actor);
actor._backgroundManager.addMenu(actor._backgroundMenu); actor._backgroundManager.addMenu(actor._backgroundMenu);
function openMenu(x, y) { function openMenu(x, y) {

View File

@ -1180,7 +1180,7 @@ var PopupMenuManager = class {
grabParams = Params.parse(grabParams, grabParams = Params.parse(grabParams,
{ actionMode: Shell.ActionMode.POPUP }); { actionMode: Shell.ActionMode.POPUP });
this._owner = owner; this._owner = owner;
this._grabHelper = new GrabHelper.GrabHelper(owner.actor, grabParams); this._grabHelper = new GrabHelper.GrabHelper(owner, grabParams);
this._menus = []; this._menus = [];
} }

View File

@ -148,7 +148,7 @@ function addContextMenu(entry, params) {
entry.menu = new EntryMenu(entry); entry.menu = new EntryMenu(entry);
entry.menu.isPassword = params.isPassword; entry.menu.isPassword = params.isPassword;
entry._menuManager = new PopupMenu.PopupMenuManager({ actor: entry }, entry._menuManager = new PopupMenu.PopupMenuManager(entry,
{ actionMode: params.actionMode }); { actionMode: params.actionMode });
entry._menuManager.addMenu(entry.menu); entry._menuManager.addMenu(entry.menu);

View File

@ -173,7 +173,7 @@ var WindowMenu = class extends PopupMenu.PopupMenu {
var WindowMenuManager = class { var WindowMenuManager = class {
constructor() { constructor() {
this._manager = new PopupMenu.PopupMenuManager({ actor: Main.layoutManager.dummyCursor }); this._manager = new PopupMenu.PopupMenuManager(Main.layoutManager.dummyCursor);
this._sourceActor = new St.Widget({ reactive: true, visible: false }); this._sourceActor = new St.Widget({ reactive: true, visible: false });
this._sourceActor.connect('button-press-event', () => { this._sourceActor.connect('button-press-event', () => {