Attempt to fix cursor breakage

This commit is contained in:
wheaney 2024-04-25 13:03:36 -07:00
parent 1264af4ff8
commit 0742eeb83a
2 changed files with 14 additions and 11 deletions

View File

@ -9,7 +9,6 @@ export class CursorManager {
constructor(mainActor) { constructor(mainActor) {
this._mainActor = mainActor; this._mainActor = mainActor;
this._enableTimeoutId = null;
this._changeHookFn = null; this._changeHookFn = null;
// Set/destroyed by _enableCloningMouse/_disableCloningMouse // Set/destroyed by _enableCloningMouse/_disableCloningMouse
@ -21,6 +20,7 @@ export class CursorManager {
this._cursorActor = null; this._cursorActor = null;
this._cursorWatcher = null; this._cursorWatcher = null;
this._cursorSeat = null; this._cursorSeat = null;
this._cursorUnfocusInhibited = false;
// Set/destroyed by _startCloningMouse / _stopCloningMouse // Set/destroyed by _startCloningMouse / _stopCloningMouse
this._cursorWatch = null; this._cursorWatch = null;
@ -35,13 +35,6 @@ export class CursorManager {
} }
disable() { 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(); this._disableCloningMouse();
} }
@ -144,8 +137,10 @@ export class CursorManager {
this._cursorTracker.set_keep_focus_while_hidden(true); 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._cursorSeat.inhibit_unfocus();
this._cursorUnfocusInhibited = true;
} }
} }
@ -180,8 +175,10 @@ export class CursorManager {
this._cursorTracker.set_keep_focus_while_hidden(false); 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._cursorSeat.uninhibit_unfocus();
this._cursorUnfocusInhibited = false;
} }
} }
@ -205,5 +202,11 @@ export class CursorManager {
}); });
this._mainActor.set_child_above_sibling(this._cursorActor, null); this._mainActor.set_child_above_sibling(this._cursorActor, null);
this._cursorTrackerSetPointerVisibleBound(false); 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();
}
} }
} }

View File

@ -86,6 +86,7 @@ export default class BreezyDesktopExtension extends Extension {
this._refresh_rate = target_monitor.refreshRate; this._refresh_rate = target_monitor.refreshRate;
if (this._check_driver_running()) { if (this._check_driver_running()) {
console.log('Ready, enabling XR effect');
this._effect_enable(); this._effect_enable();
} else { } else {
this._poll_for_ready(); this._poll_for_ready();
@ -156,7 +157,6 @@ export default class BreezyDesktopExtension extends Extension {
} }
if (this._xr_effect) { if (this._xr_effect) {
this._xr_effect.unref();
this._xr_effect = null; this._xr_effect = null;
} }