[gnome-shell/gnome-40] Magnifier: Filter caret tracking in gnome magnifier
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-40] Magnifier: Filter caret tracking in gnome magnifier
- Date: Fri, 9 Jul 2021 22:22:23 +0000 (UTC)
commit c671021c994d08b650b974004984f176e248edc9
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 12b79a3eb6..9db8e999c4 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -827,6 +827,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]