[gnome-shell/gnome-41] magnifier: Disable desaturation effect when not in use



commit 528ab6fa4b3e561d7de923bc8e82b8ce063c7882
Author: Sebastian Keller <skeller gnome org>
Date:   Mon Nov 8 05:19:32 2021 +0100

    magnifier: Disable desaturation effect when not in use
    
    The desaturation effect was always enabled, regardless of the specified
    factor. This was causing the magnifier to always hit offscreen
    rendering, even when not necessary. Additionally offscreen rendering is
    currently also causing glitches in MetaWindowGroup which this helps to
    avoid in some cases.
    
    Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/1678
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2026>
    (cherry picked from commit 34b6cd0beae9b712fb3f0402d83a45d99198b729)

 js/ui/magnifier.js | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index 180df25460..2443248d34 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -1898,6 +1898,7 @@ var MagShaderEffects = class MagShaderEffects {
         this._colorDesaturation = new Clutter.DesaturateEffect();
         this._inverse.set_enabled(false);
         this._brightnessContrast.set_enabled(false);
+        this._colorDesaturation.set_enabled(false);
 
         this._magView = uiGroupClone;
         this._magView.add_effect(this._inverse);
@@ -1930,6 +1931,7 @@ var MagShaderEffects = class MagShaderEffects {
 
     setColorSaturation(factor) {
         this._colorDesaturation.set_factor(1.0 - factor);
+        this._colorDesaturation.set_enabled(factor !== 1.0);
     }
 
     /**


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