Fix cursor enable/disable

This commit is contained in:
wheaney 2024-04-04 16:13:34 -07:00
parent 88a97542e0
commit 864a468684
1 changed files with 3 additions and 15 deletions

View File

@ -56,20 +56,6 @@ export class CursorManager {
} }
this._enableTimeoutId = null; this._enableTimeoutId = null;
this._disableCloningMouse(); this._disableCloningMouse();
// Set/destroyed by _enableCloningMouse/_disableCloningMouse
this._cursorWantedVisible = null;
this._cursorTracker = null;
this._cursorTrackerSetPointerVisible = null;
this._cursorTrackerSetPointerVisibleBound = null;
this._cursorSprite = null;
this._cursorActor = null;
this._cursorWatcher = null;
this._cursorSeat = null;
// Set/destroyed by _startCloningMouse / _stopCloningMouse
this._cursorWatch = null;
this._cursorChangedConnection = null;
this._cursorVisibilityChangedConnection = null;
} }
startCloning() { startCloning() {
@ -83,11 +69,12 @@ export class CursorManager {
} }
_enableCloningMouse() { _enableCloningMouse() {
this._cursorWantedVisible = true;
this._cursorTracker = Meta.CursorTracker.get_for_display(global.display); this._cursorTracker = Meta.CursorTracker.get_for_display(global.display);
this._cursorWantedVisible = this._cursorTracker.get_pointer_visible();
this._cursorTrackerSetPointerVisible = Meta.CursorTracker.prototype.set_pointer_visible; this._cursorTrackerSetPointerVisible = Meta.CursorTracker.prototype.set_pointer_visible;
this._cursorTrackerSetPointerVisibleBound = this._cursorTrackerSetPointerVisible.bind(this._cursorTracker); this._cursorTrackerSetPointerVisibleBound = this._cursorTrackerSetPointerVisible.bind(this._cursorTracker);
Meta.CursorTracker.prototype.set_pointer_visible = this._cursorTrackerSetPointerVisibleReplacement.bind(this); Meta.CursorTracker.prototype.set_pointer_visible = this._cursorTrackerSetPointerVisibleReplacement.bind(this);
this._cursorTrackerSetPointerVisibleBound(false); this._cursorTrackerSetPointerVisibleBound(false);
this._cursorSprite = new Clutter.Actor({ request_mode: Clutter.RequestMode.CONTENT_SIZE }); this._cursorSprite = new Clutter.Actor({ request_mode: Clutter.RequestMode.CONTENT_SIZE });
@ -101,6 +88,7 @@ export class CursorManager {
_disableCloningMouse() { _disableCloningMouse() {
this._cursorTrackerSetPointerVisibleBound(this._cursorWantedVisible); this._cursorTrackerSetPointerVisibleBound(this._cursorWantedVisible);
this._stopCloningShowMouse();
Meta.CursorTracker.prototype.set_pointer_visible = this._cursorTrackerSetPointerVisible; Meta.CursorTracker.prototype.set_pointer_visible = this._cursorTrackerSetPointerVisible;
this._cursorWantedVisible = null; this._cursorWantedVisible = null;