From b9dd946a8c7aa522a9d2e4837bdc86748a6e8859 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Sun, 6 Apr 2025 15:42:02 +0000 Subject: [PATCH] Fixes label scaling problem that causes giant labels to appear --- js/ui/realms/realmLabels.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/js/ui/realms/realmLabels.js b/js/ui/realms/realmLabels.js index 787be93bb..b9875e35f 100644 --- a/js/ui/realms/realmLabels.js +++ b/js/ui/realms/realmLabels.js @@ -317,6 +317,9 @@ const RealmWindowLabel = GObject.registerClass( actor.add_child(this); this._actor = actor; + let themeContext = St.ThemeContext.get_for_stage(global.stage); + themeContext.connect('notify::scale-factor', this._updateScale.bind(this)); + this._update(actor.metaWindow); } @@ -360,6 +363,19 @@ const RealmWindowLabel = GObject.registerClass( this._easeOpacity(255); } + // Copied from closeDialog.js + _updateScale() { + // Since this is a child of MetaWindowActor (which, for Wayland clients, + // applies the geometry scale factor to its children itself, see + // meta_window_actor_set_geometry_scale()), make sure we don't apply + // the factor twice in the end. + if (this.window.get_client_type() !== Meta.WindowClientType.WAYLAND) + return; + + let {scaleFactor} = St.ThemeContext.get_for_stage(global.stage); + this.set_scale(1 / scaleFactor, 1 / scaleFactor); + } + _updatePosition(window) { let frame_rect = window.get_frame_rect(); let buffer_rect = window.get_buffer_rect();