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
This commit is contained in:
Carlos Garnacho 2020-10-28 20:29:55 +01:00
parent 709c226fc3
commit a9a54ba2a3

View File

@ -158,7 +158,9 @@ var Magnifier = class Magnifier {
zoomRegion.setActive(activate);
});
if (isActive != activate) {
if (isActive === activate)
return;
if (activate) {
this._updateMouseSprite();
this._cursorSpriteChangedId =
@ -172,7 +174,6 @@ 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.