Skip to content

Commit

Permalink
Merge pull request home-sweet-gnome#347 from charlesg99/master
Browse files Browse the repository at this point in the history
Disconnect the window preview thumbnail from its window
  • Loading branch information
jderose9 authored Feb 27, 2018
2 parents 623fb98 + 7aba8d7 commit a460d28
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions windowPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,6 @@ var 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));

this._previewMenuPopupManager = new previewMenuPopupManager(window, this.actor);
},
Expand Down Expand Up @@ -671,6 +669,8 @@ var thumbnailPreview = new Lang.Class({
height: height * this.scale });
this._resizeId = mutterWindow.meta_window.connect('size-changed',
Lang.bind(this, this._queueResize));

this._destroyId = mutterWindow.connect('destroy', () => this.animateOutAndDestroy());
}

return thumbnail;
Expand Down Expand Up @@ -823,19 +823,25 @@ var thumbnailPreview = new Lang.Class({
});
},

_onDestroy: function() {
destroy: function() {
if (this._titleNotifyId) {
this.window.disconnect(this._titleNotifyId);
this._titleNotifyId = 0;
}

if(this._resizeId) {
let mutterWindow = this.window.get_compositor_private();
if (mutterWindow) {

let mutterWindow = this.window.get_compositor_private();

if (mutterWindow) {
if(this._resizeId) {
mutterWindow.meta_window.disconnect(this._resizeId);
this._resizeId = 0;
}

if(this._destroyId) {
mutterWindow.disconnect(this._destroyId);
}
}

this.parent();
}
});

Expand Down

0 comments on commit a460d28

Please sign in to comment.