Error out early if there is nothing to move

Fixes: #532
This commit is contained in:
Michael Stapelberg 2011-10-27 23:27:33 +01:00
parent 09a07b9169
commit 8e3cef33d9
1 changed files with 5 additions and 0 deletions

View File

@ -762,6 +762,11 @@ move:
{ {
owindow *current; owindow *current;
/* Error out early to not create a non-existing workspace (in
* workspace_get()) if we are not actually able to move anything. */
if (match_is_empty(&current_match) && focused->type == CT_WORKSPACE)
break;
printf("should move window to workspace %s\n", $3); printf("should move window to workspace %s\n", $3);
/* get the workspace */ /* get the workspace */
Con *ws = workspace_get($3, NULL); Con *ws = workspace_get($3, NULL);