From 0f9c13c55d99f195ab60cc5785a03390f441cabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 23 Jan 2025 04:41:51 +0100 Subject: [PATCH] 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: --- js/ui/windowPreview.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/ui/windowPreview.js b/js/ui/windowPreview.js index 28377fd5f..cf3fbdaa6 100644 --- a/js/ui/windowPreview.js +++ b/js/ui/windowPreview.js @@ -49,18 +49,18 @@ export const WindowPreview = GObject.registerClass({ this._workspace = workspace; this._overviewAdjustment = overviewAdjustment; + const windowContainer = new Clutter.Actor({ + pivot_point: new Graphene.Point({x: 0.5, y: 0.5}), + }); + super._init({ reactive: true, can_focus: true, accessible_role: Atk.Role.PUSH_BUTTON, 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', () => this._adjustOverlayOffsets()); // gjs currently can't handle setting an actors layout manager during