workspaceThumbnail: forbid manipulations of removed workspaces

Don't allow dragging onto a removed workspace or activating it.

https://bugzilla.gnome.org/show_bug.cgi?id=642329
This commit is contained in:
Owen W. Taylor 2011-02-14 17:09:04 -05:00
parent 89cc6807e0
commit 45fe44da85

View File

@ -328,6 +328,9 @@ WorkspaceThumbnail.prototype = {
},
_activate : function (clone, time) {
if (this.state > ThumbnailState.NORMAL)
return;
// a click on the already current workspace should go back to the main view
if (this.metaWorkspace == global.screen.get_active_workspace())
Main.overview.hide();
@ -337,6 +340,9 @@ WorkspaceThumbnail.prototype = {
// Draggable target interface
handleDragOver : function(source, actor, x, y, time) {
if (this.state > ThumbnailState.NORMAL)
return DND.DragMotionResult.CONTINUE;
if (source.realWindow)
return DND.DragMotionResult.MOVE_DROP;
if (source.shellWorkspaceLaunch)
@ -346,6 +352,9 @@ WorkspaceThumbnail.prototype = {
},
acceptDrop : function(source, actor, x, y, time) {
if (this.state > ThumbnailState.NORMAL)
return false;
if (source.realWindow) {
let win = source.realWindow;
if (this._isMyWindow(win))