[gnome-shell/gnome-3-38] magnifier: Avoid cursor visibility changes on startup



commit 50936812b51eaef2b2f1e243abe4fe9233d68eb5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Oct 28 20:29:55 2020 +0100

    magnifier: Avoid cursor visibility changes on startup
    
    When initializing the shell, we create the magnifier, and (normally)
    let it disabled. This still toggles cursor visibility on, which is
    not right since there's other considerations to take during
    initialization.
    
    Only do this after actual changes to the magnifier state, so
    initialization is left unperturbed.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1486
    
    (cherry picked from commit a9a54ba2a3b26b15c5dc3668ca8dd3d3e38ba9e6)

 js/ui/magnifier.js | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index eae7bf4642..036de7f759 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -158,20 +158,21 @@ var Magnifier = class Magnifier {
             zoomRegion.setActive(activate);
         });
 
-        if (isActive != activate) {
-            if (activate) {
-                this._updateMouseSprite();
-                this._cursorSpriteChangedId =
-                    this._cursorTracker.connect('cursor-changed',
-                                                this._updateMouseSprite.bind(this));
-                Meta.disable_unredirect_for_display(global.display);
-                this.startTrackingMouse();
-            } else {
-                this._cursorTracker.disconnect(this._cursorSpriteChangedId);
-                this._mouseSprite.content.texture = null;
-                Meta.enable_unredirect_for_display(global.display);
-                this.stopTrackingMouse();
-            }
+        if (isActive === activate)
+            return;
+
+        if (activate) {
+            this._updateMouseSprite();
+            this._cursorSpriteChangedId =
+                this._cursorTracker.connect('cursor-changed',
+                                            this._updateMouseSprite.bind(this));
+            Meta.disable_unredirect_for_display(global.display);
+            this.startTrackingMouse();
+        } else {
+            this._cursorTracker.disconnect(this._cursorSpriteChangedId);
+            this._mouseSprite.content.texture = null;
+            Meta.enable_unredirect_for_display(global.display);
+            this.stopTrackingMouse();
         }
 
         // Make sure system mouse pointer is shown when all zoom regions are


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