diff --git a/windowPreview.js b/windowPreview.js
index 80b65d7..794650f 100644
--- a/windowPreview.js
+++ b/windowPreview.js
@@ -463,7 +463,7 @@ const thumbnailPreview = new Lang.Class({
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
if(!scaleFactor)
scaleFactor = 1;
-
+
this._thumbnailWidth = DEFAULT_THUMBNAIL_WIDTH*scaleFactor;
this._thumbnailHeight = DEFAULT_THUMBNAIL_HEIGHT*scaleFactor;
@@ -502,9 +502,9 @@ const thumbnailPreview = new Lang.Class({
});
this._titleBin.add_style_class_name("preview-window-title");
- this.window.connect('notify::title', Lang.bind(this, function() {
- this._title.set_text(this.window.title);
- }));
+ this._titleNotifyId = this.window.connect('notify::title', Lang.bind(this, function() {
+ this._title.set_text(this.window.title);
+ }));
this._windowBin = new St.Bin({ child: this.overlayGroup,
x_align: St.Align.MIDDLE,
@@ -530,6 +530,8 @@ const thumbnailPreview = new Lang.Class({
Lang.bind(this, this._onLeave));
this.actor.connect('motion-event',
Lang.bind(this, this._onMotionEvent));
+ this.actor.connect('destroy',
+ Lang.bind(this, this._onDestroy));
},
_onEnter: function(actor, event) {
@@ -750,6 +752,11 @@ const thumbnailPreview = new Lang.Class({
}));
}
}
+ },
+
+ _onDestroy: function() {
+ this.window.disconnect(this._titleNotifyId);
+ this._titleNotifyId = 0;
}
});