Wrap use of actor property for 3.34

018058c9da
This commit is contained in:
Charles Gagnon
2019-06-01 14:57:08 -04:00
parent 5af20dacd8
commit 2923746348
4 changed files with 20 additions and 2 deletions

View File

@@ -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;

View File

@@ -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() {

View File

@@ -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;

View File

@@ -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(