From 0742eeb83aa4d9982eca9355683ad25bad8a7449 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Thu, 25 Apr 2024 13:03:36 -0700 Subject: [PATCH] Attempt to fix cursor breakage --- .../cursormanager.js | 23 +++++++++++-------- .../breezydesktop@org.xronlinux/extension.js | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gnome/breezydesktop@org.xronlinux/cursormanager.js b/gnome/breezydesktop@org.xronlinux/cursormanager.js index 2d8fb28..e9da4d6 100644 --- a/gnome/breezydesktop@org.xronlinux/cursormanager.js +++ b/gnome/breezydesktop@org.xronlinux/cursormanager.js @@ -9,7 +9,6 @@ export class CursorManager { constructor(mainActor) { this._mainActor = mainActor; - this._enableTimeoutId = null; this._changeHookFn = null; // Set/destroyed by _enableCloningMouse/_disableCloningMouse @@ -21,6 +20,7 @@ export class CursorManager { this._cursorActor = null; this._cursorWatcher = null; this._cursorSeat = null; + this._cursorUnfocusInhibited = false; // Set/destroyed by _startCloningMouse / _stopCloningMouse this._cursorWatch = null; @@ -35,13 +35,6 @@ export class CursorManager { } disable() { - // If _enableTimeoutId is non-null, _enable() has not run yet, and will - // not run. Do not run _disable() in this case. - GLib.source_remove(this._enableTimeoutId); - if (this._enableTimeoutId !== null) { - return; - } - this._enableTimeoutId = null; this._disableCloningMouse(); } @@ -144,8 +137,10 @@ export class CursorManager { this._cursorTracker.set_keep_focus_while_hidden(true); } - if (!this._cursorSeat.is_unfocus_inhibited()) { + if (!this._cursorUnfocusInhibited) { + console.log('Breezy debug - inhibit_unfocus\n'); this._cursorSeat.inhibit_unfocus(); + this._cursorUnfocusInhibited = true; } } @@ -180,8 +175,10 @@ export class CursorManager { this._cursorTracker.set_keep_focus_while_hidden(false); } - if (this._cursorSeat.is_unfocus_inhibited()) { + if (this._cursorUnfocusInhibited) { + console.log('Breezy debug - uninhibit_unfocus\n'); this._cursorSeat.uninhibit_unfocus(); + this._cursorUnfocusInhibited = false; } } @@ -205,5 +202,11 @@ export class CursorManager { }); this._mainActor.set_child_above_sibling(this._cursorActor, null); this._cursorTrackerSetPointerVisibleBound(false); + + // some other processes are uninhibiting when they shouldn't, so we need to re-inhibit here + if (!this._cursorSeat.is_unfocus_inhibited() && this._cursorUnfocusInhibited) { + console.log('Breezy debug - reinhibiting\n'); + this._cursorSeat.inhibit_unfocus(); + } } } \ No newline at end of file diff --git a/gnome/breezydesktop@org.xronlinux/extension.js b/gnome/breezydesktop@org.xronlinux/extension.js index 7003970..3ed4e9d 100644 --- a/gnome/breezydesktop@org.xronlinux/extension.js +++ b/gnome/breezydesktop@org.xronlinux/extension.js @@ -86,6 +86,7 @@ export default class BreezyDesktopExtension extends Extension { this._refresh_rate = target_monitor.refreshRate; if (this._check_driver_running()) { + console.log('Ready, enabling XR effect'); this._effect_enable(); } else { this._poll_for_ready(); @@ -156,7 +157,6 @@ export default class BreezyDesktopExtension extends Extension { } if (this._xr_effect) { - this._xr_effect.unref(); this._xr_effect = null; }