[gnome-shell/gnome-3-30] boxpointer: Unset the sourceActor on destruction
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-30] boxpointer: Unset the sourceActor on destruction
- Date: Wed, 26 Jun 2019 15:04:36 +0000 (UTC)
commit d41669189690dc8fb38e3e2e90d70917cbc84e64
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Thu Jun 13 16:57:38 2019 +0000
boxpointer: Unset the sourceActor on destruction
A boxpointer sourceActor could be destroyed before the boxpointer itself.
In such case, unset the sourceActor reference, connecting to 'destroy' signal.
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1295
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/576
(cherry picked from commit 2fd120162fe49bc85d7773435ac1412c512c5af4)
js/ui/boxpointer.js | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index d51877d18..9eae0b615 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -61,6 +61,15 @@ var BoxPointer = new Lang.Class({
this._sourceAlignment = 0.5;
this._capturedEventId = 0;
this._muteInput();
+
+ this.actor.connect('destroy', this._onDestroy.bind(this));
+ },
+
+ _onDestroy() {
+ if (this._sourceActorDestroyId) {
+ this._sourceActor.disconnect(this._sourceActorDestroyId);
+ delete this._sourceActorDestroyId;
+ }
},
get arrowSide() {
@@ -424,9 +433,26 @@ var BoxPointer = new Lang.Class({
// so that we can query the correct size.
this.actor.show();
- this._sourceActor = sourceActor;
+ if (!this._sourceActor || sourceActor != this._sourceActor) {
+ if (this._sourceActorDestroyId) {
+ this._sourceActor.disconnect(this._sourceActorDestroyId);
+ delete this._sourceActorDestroyId;
+ }
+
+ this._sourceActor = sourceActor;
+
+ if (this._sourceActor) {
+ this._sourceActorDestroyId = this._sourceActor.connect('destroy', () => {
+ this._sourceActor = null;
+ delete this._sourceActorDestroyId;
+ })
+ }
+ }
this._arrowAlignment = alignment;
+ if (!this._sourceActor)
+ return;
+
this._reposition();
this._updateFlip();
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]