From 489f3306e678b60501e2f217c73bff51e1cf5303 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 2 Feb 2009 20:54:33 +0000 Subject: [PATCH] Fix a crash deleting a workspace, and another crash if the user tries to select a workspace after deleting it. svn path=/trunk/; revision=174 --- js/ui/workspaces.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/ui/workspaces.js b/js/ui/workspaces.js index c75299605..53bcf9535 100644 --- a/js/ui/workspaces.js +++ b/js/ui/workspaces.js @@ -419,7 +419,7 @@ Workspace.prototype = { reactive: true }); this._removeButton.set_from_file(global.imagedir + "remove-workspace.svg"); - this._removeButton.connect('button-press-event', Lang.bind(this, this._removeSelf)); + this._removeButton.connect('button-release-event', Lang.bind(this, this._removeSelf)); this.actor.add_actor(this._removeButton); this._adjustRemoveButton(); @@ -674,6 +674,10 @@ Workspace.prototype = { }); this._visible = false; + + // Don't let the user try to select this workspace as it's + // making its exit. + this._desktop.reactive = false; }, destroy : function() { @@ -757,6 +761,7 @@ Workspace.prototype = { let workspace = screen.get_workspace_by_index(this.workspaceNum); screen.remove_workspace(workspace, event.get_time()); + return true; } }; @@ -830,7 +835,7 @@ Workspaces.prototype = { reactive: true }); plus.set_from_file(global.imagedir + "add-workspace.svg"); - plus.connect('button-press-event', this._appendNewWorkspace); + plus.connect('button-release-event', this._appendNewWorkspace); this.actor.add_actor(plus); plus.lower_bottom();