magnifier: Sanity check coordinates in scrollContentsTo

We may receive a11y events with bogus coordinates (eg. x/y = minint),
so ensure the coordinates are sane before scrolling there.

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

View File

@ -1168,6 +1168,10 @@ var ZoomRegion = class ZoomRegion {
* @param {number} y: The y-coord of the point to center on. * @param {number} y: The y-coord of the point to center on.
*/ */
scrollContentsTo(x, y) { scrollContentsTo(x, y) {
if (x < 0 || x > global.screen_width ||
y < 0 || y > global.screen_height)
return;
this._clearScrollContentsTimer(); this._clearScrollContentsTimer();
this._followingCursor = false; this._followingCursor = false;