[gnome-shell/gnome-3-38] Magnifier: Filter caret tracking in gnome magnifier



commit 7a271666c45a4995f542f23cfdbec8e134e3b119
Author: Lee <lclark125 gmail com>
Date:   Sat Apr 24 18:03:35 2021 +0100

    Magnifier: Filter caret tracking in gnome magnifier
    
    Add a check to filter out caret tracking events that result in a caret
    location of 0,0.
    
    Fixes #4177
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1823>
    (cherry picked from commit 006d206f98696035770e72ceec712c456122f330)

 js/ui/magnifier.js | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index a92ec14da0..3a778b68d4 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -830,6 +830,12 @@ var ZoomRegion = class ZoomRegion {
         let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
         let [xCaret, yCaret] = [extents.x * scaleFactor, extents.y * scaleFactor];
 
+        // Ignore event(s) if the caret size is none (0x0). This happens a lot if
+        // the cursor offset can't be translated into a location. This is a work
+        // around.
+        if (extents.width === 0 && extents.height === 0)
+            return;
+
         if (this._xCaret !== xCaret || this._yCaret !== yCaret) {
             [this._xCaret, this._yCaret] = [xCaret, yCaret];
             this._centerFromCaretPosition();


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