windowPreview: Set window container during construction

The container is tightly coupled with the preview, and there is
never a need to replace it at a later point. Set it directly
during construction, so the underlying base class can make
this explicit by marking the property as construct-only.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
This commit is contained in:
Florian Müllner 2025-01-23 04:41:51 +01:00 committed by Marge Bot
parent eae1e8b170
commit 0f9c13c55d

View File

@ -49,18 +49,18 @@ export const WindowPreview = GObject.registerClass({
this._workspace = workspace; this._workspace = workspace;
this._overviewAdjustment = overviewAdjustment; this._overviewAdjustment = overviewAdjustment;
const windowContainer = new Clutter.Actor({
pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
});
super._init({ super._init({
reactive: true, reactive: true,
can_focus: true, can_focus: true,
accessible_role: Atk.Role.PUSH_BUTTON, accessible_role: Atk.Role.PUSH_BUTTON,
offscreen_redirect: Clutter.OffscreenRedirect.AUTOMATIC_FOR_OPACITY, offscreen_redirect: Clutter.OffscreenRedirect.AUTOMATIC_FOR_OPACITY,
windowContainer,
}); });
const windowContainer = new Clutter.Actor({
pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
});
this.window_container = windowContainer;
windowContainer.connect('notify::scale-x', windowContainer.connect('notify::scale-x',
() => this._adjustOverlayOffsets()); () => this._adjustOverlayOffsets());
// gjs currently can't handle setting an actors layout manager during // gjs currently can't handle setting an actors layout manager during