[gnome-shell/wip/carlosg/magnifier-cursor] magnifier: Avoid cursor visibility changes on startup




commit 0f7212d25b7f8416bd364772db12644170095879
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

 js/ui/magnifier.js | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index eae7bf4642..4844eae0a6 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -172,15 +172,15 @@ var Magnifier = class Magnifier {
                 Meta.enable_unredirect_for_display(global.display);
                 this.stopTrackingMouse();
             }
-        }
 
-        // Make sure system mouse pointer is shown when all zoom regions are
-        // invisible.
-        if (!activate)
-            this.showSystemCursor();
+            // Make sure system mouse pointer is shown when all zoom regions are
+            // invisible.
+            if (!activate)
+                this.showSystemCursor();
 
-        // Notify interested parties of this change
-        this.emit('active-changed', activate);
+            // Notify interested parties of this change
+            this.emit('active-changed', activate);
+        }
     }
 
     /**


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