From 26e3ccda496cb62f0b4e3b6e1edbfbb0f738eac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 30 Nov 2017 02:34:42 +0100 Subject: [PATCH] loginDialog: Load logo file texture given resource scale And reload the logo if the resource scale changes. https://bugzilla.gnome.org/show_bug.cgi?id=765011 --- js/gdm/loginDialog.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index bf7577c36..6c4d1357d 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -481,6 +481,9 @@ var LoginDialog = GObject.registerClass({ this._logoBin = new St.Widget({ style_class: 'login-dialog-logo-bin', x_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.END }); + this._logoBin.connect('resource-scale-changed', () => { + this._updateLogoTexture(this._textureCache, this._logoFile); + }); this.add_child(this._logoBin); this._updateLogo(); @@ -778,12 +781,12 @@ var LoginDialog = GObject.registerClass({ return; this._logoBin.destroy_all_children(); - if (this._logoFile) { + if (this._logoFile && this._logoBin.resource_scale > 0) { let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; this._logoBin.add_child(this._textureCache.load_file_async(this._logoFile, -1, _LOGO_ICON_HEIGHT, scaleFactor, - 1)); + this._logoBin.resource_scale)); } }