From 7e4f7c7e5b9c3d038250e8344b1e4b4b98e2ac10 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 16 Nov 2022 11:22:18 +0100 Subject: [PATCH] keyboard: Explicitly destroy swipeTracker after emoji panel destruction Even though the emoji panel may be destroyed with the OSK, the swipeTracker that is set up to navigate between pages is left lingering, and handling events for some gestures in the stage. This results in warnings like: JS ERROR: TypeError: this._panel is null set delta@resource:///org/gnome/shell/ui/keyboard.js:720:9 _onSwipeUpdate@resource:///org/gnome/shell/ui/keyboard.js:750:22 _updateGesture@resource:///org/gnome/shell/ui/swipeTracker.js:670:14 vfunc_gesture_progress@resource:///org/gnome/shell/ui/swipeTracker.js:288> on touch interaction after the OSK was shown and dismissed. In order to fix this, issue explicit destruction of the swipeTracker when the emoji pager actor is destroyed. Part-of: --- js/ui/keyboard.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index a158425a6..66f35ea83 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -685,6 +685,15 @@ var EmojiPager = GObject.registerClass({ swipeTracker.connect('update', this._onSwipeUpdate.bind(this)); swipeTracker.connect('end', this._onSwipeEnd.bind(this)); this._swipeTracker = swipeTracker; + + this.connect('destroy', () => this._onDestroy()); + } + + _onDestroy() { + if (this._swipeTracker) { + this._swipeTracker.destroy(); + delete this._swipeTracker; + } } get delta() {