From 2923746348fe4a51558b892a1bedd9dc2b7c2714 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Sat, 1 Jun 2019 14:57:08 -0400 Subject: [PATCH] Wrap use of actor property for 3.34 https://gitlab.gnome.org/fmuellner/gnome-shell/commit/018058c9daed47011e8fbf48ff55e6c86317bea4 --- appIcons.js | 9 +++++++-- panel.js | 3 +++ panelManager.js | 1 + utils.js | 9 +++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/appIcons.js b/appIcons.js index d3db3ea..b9d8e03 100644 --- a/appIcons.js +++ b/appIcons.js @@ -131,6 +131,8 @@ var taskbarAppIcon = Utils.defineClass({ this.callParent('_init', appInfo.app, iconParams); + Utils.wrapActor(this.icon); + this._dot.set_width(0); this._isGroupApps = this._dtpSettings.get_boolean('group-apps'); @@ -1517,10 +1519,13 @@ var ShowAppsIconWrapper = Utils.defineClass({ this._dtpSettings = settings; this.realShowAppsIcon = new Dash.ShowAppsIcon(); + Utils.wrapActor(this.realShowAppsIcon); + Utils.wrapActor(this.realShowAppsIcon.toggleButton); + /* the variable equivalent to toggleButton has a different name in the appIcon class (actor): duplicate reference to easily reuse appIcon methods */ this.actor = this.realShowAppsIcon.toggleButton; - (this.realShowAppsIcon.actor || this.realShowAppsIcon).y_align = Clutter.ActorAlign.START; + this.realShowAppsIcon.actor.y_align = Clutter.ActorAlign.START; // Re-use appIcon methods this._removeMenuTimeout = AppDisplay.AppIcon.prototype._removeMenuTimeout; @@ -1543,7 +1548,7 @@ var ShowAppsIconWrapper = Utils.defineClass({ this.actor.connect('popup-menu', Lang.bind(this, this._onKeyboardPopupMenu)); this._menu = null; - this._menuManager = new PopupMenu.PopupMenuManager(this); + this._menuManager = new PopupMenu.PopupMenuManager(this.actor); this._menuTimeoutId = 0; this.realShowAppsIcon.showLabel = ItemShowLabel; diff --git a/panel.js b/panel.js index 45d06a5..20dc1f8 100644 --- a/panel.js +++ b/panel.js @@ -70,6 +70,9 @@ var dtpPanelWrapper = Utils.defineClass({ this.panel = panel; this.panelBox = panelBox; this.isSecondary = isSecondary; + + Utils.wrapActor(this.panel); + Utils.wrapActor(this.panel.statusArea.activities || 0); }, enable : function() { diff --git a/panelManager.js b/panelManager.js index 1eea9e2..5e939cd 100755 --- a/panelManager.js +++ b/panelManager.js @@ -268,6 +268,7 @@ var dtpPanelManager = Utils.defineClass({ _adjustPanelMenuButton: function(button, monitor, arrowSide) { if (button) { + Utils.wrapActor(button); button.menu._boxPointer._dtpSourceActor = button.menu._boxPointer.sourceActor; button.menu._boxPointer.sourceActor = button.actor; button.menu._boxPointer._userArrowSide = arrowSide; diff --git a/utils.js b/utils.js index 14a6163..e83393f 100644 --- a/utils.js +++ b/utils.js @@ -21,6 +21,7 @@ * Some code was also adapted from the upstream Gnome Shell source code. */ +const Clutter = imports.gi.Clutter; const GdkPixbuf = imports.gi.GdkPixbuf const Gi = imports._gi; const Gio = imports.gi.Gio; @@ -279,6 +280,14 @@ var hookVfunc = function(proto, symbol, func) { } }; +var wrapActor = function(actor) { + if (actor) { + Object.defineProperty(actor, 'actor', { + value: actor instanceof Clutter.Actor ? actor : actor.actor + }); + } +}; + var addKeybinding = function(key, settings, handler, modes) { if (!Main.wm._allowedKeybindings[key]) { Main.wm.addKeybinding(