Don't add a new workspace when the maximum workspaces limit is reached

It was previously possible to add a workspace above the maximum workspaces
limit by dragging an item to the "add workspace" button or using the middle
mouse button click.

Provide the user with feedback in the info bar when it is not possible to create
a new workspace or remove the current workspace.

https://bugzilla.gnome.org/show_bug.cgi?id=591645
This commit is contained in:
Marina Zhurakhinskaya
2010-05-13 14:29:00 -04:00
parent ec6bc8f216
commit 4ce2620b68
3 changed files with 38 additions and 33 deletions

View File

@ -459,10 +459,12 @@ AppWellIcon.prototype = {
this._onActivate(event);
} else if (button == 2) {
let newWorkspace = Main.overview.workspaces.addWorkspace();
newWorkspace.activate(global.get_current_time());
this.emit('launching');
this.app.open_new_window();
Main.overview.hide();
if (newWorkspace != null) {
newWorkspace.activate(global.get_current_time());
this.emit('launching');
this.app.open_new_window();
Main.overview.hide();
}
} else if (button == 3) {
// Don't bind to the right click here; we want left click outside the
// area to deactivate as well.