[gnome-shell] workspace: avoid an assertion in a new window/deleted workspace race



commit e38d83fd443fa9a416acaed1b439bfffa875fc12
Author: Dan Winship <danw gnome org>
Date:   Wed Apr 20 16:04:03 2011 -0400

    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 3a07585..2d48766 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 96fd52b..8c12e86 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;
                                         }));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]