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>
This commit is contained in:
Sebastian Keller 2021-11-08 05:19:32 +01:00 committed by Marge Bot
parent 48f8aec676
commit 34b6cd0bea

View File

@ -1898,6 +1898,7 @@ var MagShaderEffects = class MagShaderEffects {
this._colorDesaturation = new Clutter.DesaturateEffect(); this._colorDesaturation = new Clutter.DesaturateEffect();
this._inverse.set_enabled(false); this._inverse.set_enabled(false);
this._brightnessContrast.set_enabled(false); this._brightnessContrast.set_enabled(false);
this._colorDesaturation.set_enabled(false);
this._magView = uiGroupClone; this._magView = uiGroupClone;
this._magView.add_effect(this._inverse); this._magView.add_effect(this._inverse);
@ -1930,6 +1931,7 @@ var MagShaderEffects = class MagShaderEffects {
setColorSaturation(factor) { setColorSaturation(factor) {
this._colorDesaturation.set_factor(1.0 - factor); this._colorDesaturation.set_factor(1.0 - factor);
this._colorDesaturation.set_enabled(factor !== 1.0);
} }
/** /**