From 73ac5a67b6fbd5c628fcf0f9471e708c26679f0d Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:48:31 -0700 Subject: [PATCH] Fix GNOME 46 compatibility issue --- .../cursormanager.js | 18 +++++++++++++++--- gnome/breezydesktop@org.xronlinux/extension.js | 6 +++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/gnome/breezydesktop@org.xronlinux/cursormanager.js b/gnome/breezydesktop@org.xronlinux/cursormanager.js index 7be5aa7..2d8fb28 100644 --- a/gnome/breezydesktop@org.xronlinux/cursormanager.js +++ b/gnome/breezydesktop@org.xronlinux/cursormanager.js @@ -73,7 +73,11 @@ export class CursorManager { this._cursorSprite.content = new MouseSpriteContent(); this._cursorActor = new Clutter.Actor(); - this._cursorActor.add_actor(this._cursorSprite); + if (Clutter.Container === undefined) { + this._cursorActor.add_child(this._cursorSprite); + } else { + this._cursorActor.add_actor(this._cursorSprite); + } this._cursorWatcher = PointerWatcher.getPointerWatcher(); this._cursorSeat = Clutter.get_default_backend().get_default_seat(); } @@ -119,7 +123,11 @@ export class CursorManager { // prereqs: setup in _enableCloningMouse, _cursorWantedVisible is true _startCloningMouse() { if (this._cursorWatch == null) { - this._mainActor.add_actor(this._cursorActor); + if (Clutter.Container === undefined) { + this._mainActor.add_child(this._cursorActor); + } else { + this._mainActor.add_actor(this._cursorActor); + } this._cursorChangedConnection = this._cursorTracker.connect('cursor-changed', this._updateMouseSprite.bind(this)); this._cursorVisibilityChangedConnection = this._cursorTracker.connect('visibility-changed', this._updateMouseSprite.bind(this)); this._cursorPositionInvalidatedConnection = this._cursorTracker.connect('position-invalidated', this._updateMouseSprite.bind(this)); @@ -161,7 +169,11 @@ export class CursorManager { this._cursorTracker.disconnect(this._cursorPositionInvalidatedConnection); this._cursorPositionInvalidatedConnection = null; - this._mainActor.remove_actor(this._cursorActor); + if (Clutter.Container === undefined) { + this._mainActor.remove_child(this._cursorActor); + } else { + this._mainActor.remove_actor(this._cursorActor); + } } if (this._cursorTracker.set_keep_focus_while_hidden) { diff --git a/gnome/breezydesktop@org.xronlinux/extension.js b/gnome/breezydesktop@org.xronlinux/extension.js index 7418d9b..7003970 100644 --- a/gnome/breezydesktop@org.xronlinux/extension.js +++ b/gnome/breezydesktop@org.xronlinux/extension.js @@ -116,7 +116,11 @@ export default class BreezyDesktopExtension extends Extension { const uiClone = new Clutter.Clone({ source: Main.layoutManager.uiGroup, clip_to_allocation: true }); uiClone.x = -this._target_monitor.x; uiClone.y = -this._target_monitor.y; - overlayContent.add_actor(uiClone); + if (Clutter.Container === undefined) { + overlayContent.add_child(uiClone); + } else { + overlayContent.add_actor(uiClone); + } this._overlay.set_child(overlayContent);