[gnome-shell] unlockDialog: Multiply blur sigma value with the scale factor



commit e1be4ba434e7b267f9383cca9379160a3c033ddb
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Tue Feb 11 20:19:50 2020 +0100

    unlockDialog: Multiply blur sigma value with the scale factor
    
    Since the blur sigma decides how many pixels get factored in when
    blurring and setting a scale factor increases the background texture by
    that factor, the sigma value should also be multiplied by the scale
    factor.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/991

 js/ui/unlockDialog.js | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index 9dc809b4d4..0e01e9aacc 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -514,10 +514,18 @@ var UnlockDialog = GObject.registerClass({
 
         this._backgroundGroup.add_child(widget);
 
-        widget.add_effect(new Shell.BlurEffect({
+        const themeContext = St.ThemeContext.get_for_stage(global.stage);
+
+        let effect = new Shell.BlurEffect({
             brightness: BLUR_BRIGHTNESS,
-            sigma: BLUR_SIGMA,
-        }));
+            sigma: BLUR_SIGMA * themeContext.scale_factor,
+        });
+
+        this._scaleChangedId = themeContext.connect('notify::scale-factor', () => {
+            effect.sigma = BLUR_SIGMA * themeContext.scale_factor;
+        });
+
+        widget.add_effect(effect);
     }
 
     _updateBackgrounds() {
@@ -679,6 +687,12 @@ var UnlockDialog = GObject.registerClass({
             Main.layoutManager.disconnect(this._monitorsChangedId);
             delete this._monitorsChangedId;
         }
+
+        let themeContext = St.ThemeContext.get_for_stage(global.stage);
+        if (this._scaleChangedId) {
+            themeContext.disconnect(this._scaleChangedId);
+            delete this._scaleChangedId;
+        }
     }
 
     cancel() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]