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
This commit is contained in:
Dan Winship 2011-04-20 16:04:03 -04:00 committed by Owen W. Taylor
parent d97657b151
commit e38d83fd44
2 changed files with 6 additions and 2 deletions

View File

@ -1113,7 +1113,9 @@ Workspace.prototype = {
// the compositor finds out about them... // the compositor finds out about them...
Mainloop.idle_add(Lang.bind(this, Mainloop.idle_add(Lang.bind(this,
function () { function () {
if (this.actor && metaWin.get_compositor_private()) if (this.actor &&
metaWin.get_compositor_private() &&
metaWin.get_workspace() == this.metaWorkspace)
this._doAddWindow(metaWin); this._doAddWindow(metaWin);
return false; return false;
})); }));

View File

@ -276,7 +276,9 @@ WorkspaceThumbnail.prototype = {
// the compositor finds out about them... // the compositor finds out about them...
Mainloop.idle_add(Lang.bind(this, Mainloop.idle_add(Lang.bind(this,
function () { function () {
if (this.actor && metaWin.get_compositor_private()) if (this.actor &&
metaWin.get_compositor_private() &&
metaWin.get_workspace() == this.metaWorkspace)
this._doAddWindow(metaWin); this._doAddWindow(metaWin);
return false; return false;
})); }));