From 9e881ab6371fd57cb9cafe5597c59c2e8484b1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 27 Feb 2019 02:08:26 +0100 Subject: [PATCH] animation: Reload sliced texture on global scale change When the scale has changed we need to reload the texture at proper size. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5 --- js/ui/animation.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/ui/animation.js b/js/ui/animation.js index 0d711567f..c21b22565 100644 --- a/js/ui/animation.js +++ b/js/ui/animation.js @@ -18,6 +18,10 @@ var Animation = class { this.actor.connect('resource-scale-changed', this._loadFile.bind(this, file, width, height)); + let themeContext = St.ThemeContext.get_for_stage(global.stage); + this._scaleChangedId = themeContext.connect('notify::scale-factor', + this._loadFile.bind(this, file, width, height)); + this._speed = speed; this._isLoaded = false; @@ -104,6 +108,11 @@ var Animation = class { _onDestroy() { this.stop(); + + let themeContext = St.ThemeContext.get_for_stage(global.stage); + if (this._scaleChangedId) + themeContext.disconnect(this._scaleChangedId); + this._scaleChangedId = 0; } };