diff --git a/windowPreview.js b/windowPreview.js index c78f5c05d..32e0a4611 100644 --- a/windowPreview.js +++ b/windowPreview.js @@ -60,7 +60,10 @@ export class WindowPreviewMenu extends PopupMenu.PopupMenu { }); this._destroyId = this._source.connect('destroy', this.destroy.bind(this)); - Main.uiGroup.add_child(this.actor); + if (Main.uiGroup.add_actor) + Main.uiGroup.add_actor(this.actor); + else + Main.uiGroup.add_child(this.actor); this.connect('destroy', this._onDestroy.bind(this)); } @@ -109,7 +112,10 @@ class WindowPreviewList extends PopupMenu.PopupMenuSection { this.isHorizontal = position === St.Side.BOTTOM || position === St.Side.TOP; this.box.set_vertical(!this.isHorizontal); this.box.set_name('dashtodockWindowList'); - this.actor.add_child(this.box); + if (this.actor.add_actor) + this.actor.add_actor(this.box); + else + this.actor.add_child(this.box); this.actor._delegate = this; this._shownInitially = false; @@ -359,7 +365,10 @@ class WindowPreviewMenuItem extends PopupMenu.PopupBaseMenuItem { ? Clutter.ActorAlign.START : Clutter.ActorAlign.END, y_align: Clutter.ActorAlign.START, }); - this.closeButton.set_child(new St.Icon({icon_name: 'window-close-symbolic'})); + if (this.closeButton.add_actor) + this.closeButton.add_actor(new St.Icon({icon_name: 'window-close-symbolic'})); + else + this.closeButton.add_child(new St.Icon({icon_name: 'window-close-symbolic'})); this.closeButton.connect('clicked', () => this._closeWindow()); const overlayGroup = new Clutter.Actor({ @@ -387,8 +396,13 @@ class WindowPreviewMenuItem extends PopupMenu.PopupBaseMenuItem { x_expand: true, }); - box.add_child(overlayGroup); - box.add_child(labelBin); + if (box.add) { + box.add(overlayGroup); + box.add(labelBin); + } else { + box.add_child(overlayGroup); + box.add_child(labelBin); + } this._box = box; this.add_child(box);