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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2543>
(cherry picked from commit 7e4f7c7e5b)
This commit is contained in:
Carlos Garnacho 2022-11-16 11:22:18 +01:00 committed by Florian Müllner
parent 929c797f31
commit cd7524e8b3

View file

@ -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() {