Fixes label scaling problem that causes giant labels to appear
This commit is contained in:
parent
fafe56b0bb
commit
c47b061e59
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user