loginDialog: Get resource scale by get_resource_scale

To shut up 'Getting invalid resource scale property' warnings in the log.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1206
This commit is contained in:
Xiaoguang Wang 2020-04-21 16:17:09 +08:00 committed by Florian Müllner
parent 6aa1b817c9
commit be12c71534

View File

@ -810,12 +810,13 @@ var LoginDialog = GObject.registerClass({
return; return;
this._logoBin.destroy_all_children(); this._logoBin.destroy_all_children();
if (this._logoFile && this._logoBin.resource_scale > 0) { const [valid, resourceScale] = this._logoBin.get_resource_scale();
if (this._logoFile && valid) {
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
this._logoBin.add_child(this._textureCache.load_file_async(this._logoFile, this._logoBin.add_child(this._textureCache.load_file_async(this._logoFile,
-1, -1, -1, -1,
scaleFactor, scaleFactor,
this._logoBin.resource_scale)); resourceScale));
} }
} }