From e38d83fd443fa9a416acaed1b439bfffa875fc12 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 20 Apr 2011 16:04:03 -0400 Subject: [PATCH] workspace: avoid an assertion in a new window/deleted workspace race If a window appeared on a workspace that was then quickly removed, we could hit an assertion in mutter. Avoid that. https://bugzilla.gnome.org/show_bug.cgi?id=648132 --- js/ui/workspace.js | 4 +++- js/ui/workspaceThumbnail.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 3a07585ad..2d487660e 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -1113,7 +1113,9 @@ Workspace.prototype = { // the compositor finds out about them... Mainloop.idle_add(Lang.bind(this, function () { - if (this.actor && metaWin.get_compositor_private()) + if (this.actor && + metaWin.get_compositor_private() && + metaWin.get_workspace() == this.metaWorkspace) this._doAddWindow(metaWin); return false; })); diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index 96fd52bc5..8c12e86c0 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -276,7 +276,9 @@ WorkspaceThumbnail.prototype = { // the compositor finds out about them... Mainloop.idle_add(Lang.bind(this, function () { - if (this.actor && metaWin.get_compositor_private()) + if (this.actor && + metaWin.get_compositor_private() && + metaWin.get_workspace() == this.metaWorkspace) this._doAddWindow(metaWin); return false; }));