magnifier: Ignore repeated a11y events

We may get several a11y events setting the caret on the same
coordinates it previously was. Make focus tracking ignore those,
as we're jumping to the same coordinates again during eg. mouse
operation.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/984
This commit is contained in:
Carlos Garnacho 2020-02-06 10:56:44 +01:00 committed by Florian Müllner
parent 42b50051ac
commit c8d02be14a

View File

@ -799,10 +799,14 @@ var ZoomRegion = class ZoomRegion {
return; return;
} }
[this._xFocus, this._yFocus] = [extents.x + (extents.width / 2), let [xFocus, yFocus] = [extents.x + (extents.width / 2),
extents.y + (extents.height / 2)]; extents.y + (extents.height / 2)];
if (this._xFocus !== xFocus || this._yFocus !== yFocus) {
[this._xFocus, this._yFocus] = [xFocus, yFocus];
this._centerFromFocusPosition(); this._centerFromFocusPosition();
} }
}
_updateCaret(caller, event) { _updateCaret(caller, event) {
let text = event.source.get_text_iface(); let text = event.source.get_text_iface();
@ -816,9 +820,13 @@ var ZoomRegion = class ZoomRegion {
return; return;
} }
[this._xCaret, this._yCaret] = [extents.x, extents.y]; let [xCaret, yCaret] = [extents.x, extents.y];
if (this._xCaret !== xCaret || this._yCaret !== yCaret) {
[this._xCaret, this._yCaret] = [xCaret, yCaret];
this._centerFromCaretPosition(); this._centerFromCaretPosition();
} }
}
/** /**
* setActive: * setActive: