magnifier: Fix cursor offset

Commit c449058d44 changed the pointer clone to use a single
actor. However that broke applying the hotspot translation to the
position, so the magnified cursor is now displayed with a shift.

Undo the change to restore the old behavior.

This reverts commit c449058d44.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2780>
This commit is contained in:
Андрей Гриценко 2023-05-29 17:42:13 +03:00 committed by Florian Müllner
parent 8fb8f7f827
commit ae24b0247e

View File

@ -103,12 +103,15 @@ var Magnifier = class Magnifier extends Signals.EventEmitter {
this._mouseSprite = new Clutter.Actor({ request_mode: Clutter.RequestMode.CONTENT_SIZE });
this._mouseSprite.content = new MouseSpriteContent();
this._cursorRoot = new Clutter.Actor();
this._cursorRoot.add_actor(this._mouseSprite);
// Create the first ZoomRegion and initialize it according to the
// magnification settings.
[this.xMouse, this.yMouse] = global.get_pointer();
let aZoomRegion = new ZoomRegion(this, this._mouseSprite);
let aZoomRegion = new ZoomRegion(this, this._cursorRoot);
this._zoomRegions.push(aZoomRegion);
this._settingsInit(aZoomRegion);
aZoomRegion.scrollContentsTo(this.xMouse, this.yMouse);
@ -283,7 +286,7 @@ var Magnifier = class Magnifier extends Signals.EventEmitter {
* @returns {ZoomRegion} the newly created ZoomRegion.
*/
createZoomRegion(xMagFactor, yMagFactor, roi, viewPort) {
let zoomRegion = new ZoomRegion(this, this._mouseSprite);
let zoomRegion = new ZoomRegion(this, this._cursorRoot);
zoomRegion.setViewPort(viewPort);
// We ignore the redundant width/height on the ROI