Skip to content

Commit

Permalink
Use add_child in all the possible places
Browse files Browse the repository at this point in the history
add_child() method does work in Gnome 45 too for nearly all the
places. There is only one place where it produces a problem,
which is with the scrollView element. Using add_actor() there
is mandatory to keep compatibility with Gnome 45, at least
until we discover why it breaks the size detection.

I suspect that when this problem is fixed in Gnome 45, it will
also fix the size and placement problems in Gnome 46.
  • Loading branch information
sergio-costas committed Feb 26, 2024
1 parent ccbbd62 commit 4945dbf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion appIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ const DockAppIconMenu = class DockAppIconMenu extends PopupMenu.PopupMenu {
});
source.connect('destroy', () => this.destroy());

Utils.addActor(Main.uiGroup, this.actor);
Main.uiGroup.add_child(this.actor);

const {remoteModel} = Docking.DockManager.getDefault();
const remoteModelApp = remoteModel?.lookupById(this._source?.app?.id);
Expand Down
4 changes: 2 additions & 2 deletions dash.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ export const DockDash = GObject.registerClass({
x_expand: this._isHorizontal,
});
this._box._delegate = this;
Utils.addActor(this._dashContainer, this._scrollView);
Utils.addActor(this._boxContainer, this._box);
this._boxContainer.add_child(this._box);
Utils.addActor(this._scrollView, this._boxContainer);
this._dashContainer.add_child(this._scrollView);

this._showAppsIcon = new AppIcons.DockShowAppsIcon(this._position);
this._showAppsIcon.show(false);
Expand Down
2 changes: 1 addition & 1 deletion docking.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ const DockedDash = GObject.registerClass({
// Add dash container actor and the container to the Chrome.
this.set_child(this._slider);
this._slider.set_child(this._box);
Utils.addActor(this._box, this.dash);
this._box.add_child(this.dash);

// Add aligning container without tracking it for input region
this._trackDock();
Expand Down
12 changes: 6 additions & 6 deletions windowPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class WindowPreviewMenu extends PopupMenu.PopupMenu {
});
this._destroyId = this._source.connect('destroy', this.destroy.bind(this));

Utils.addActor(Main.uiGroup, this.actor);
Main.uiGroup.add_child(this.actor);

this.connect('destroy', this._onDestroy.bind(this));
}
Expand Down Expand Up @@ -109,7 +109,7 @@ 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');
Utils.addActor(this.actor, this.box);
this.actor.add_child(this.box);
this.actor._delegate = this;

this._shownInitially = false;
Expand Down Expand Up @@ -359,16 +359,16 @@ class WindowPreviewMenuItem extends PopupMenu.PopupBaseMenuItem {
? Clutter.ActorAlign.START : Clutter.ActorAlign.END,
y_align: Clutter.ActorAlign.START,
});
Utils.addActor(this.closeButton, new St.Icon({icon_name: 'window-close-symbolic'}));
this.closeButton.add_child(new St.Icon({icon_name: 'window-close-symbolic'}));
this.closeButton.connect('clicked', () => this._closeWindow());

const overlayGroup = new Clutter.Actor({
layout_manager: new Clutter.BinLayout(),
y_expand: true,
});

Utils.addActor(overlayGroup, this._cloneBin);
Utils.addActor(overlayGroup, this.closeButton);
overlayGroup.add_child(this._cloneBin);
overlayGroup.add_child(this.closeButton);

const label = new St.Label({text: window.get_title()});
label.set_style(`max-width: ${PREVIEW_MAX_WIDTH}px`);
Expand All @@ -394,7 +394,7 @@ class WindowPreviewMenuItem extends PopupMenu.PopupBaseMenuItem {
box.add_child(labelBin);
}
this._box = box;
Utils.addActor(this, box);
this.add_child(box);

this._cloneTexture(window);

Expand Down

0 comments on commit 4945dbf

Please sign in to comment.