Check if con_id exists in cmd_swap (#2898)

Also adds some testcases for swap using con_id.

Fixes #2895
This commit is contained in:
Orestis
2017-09-06 08:34:14 +03:00
committed by Michael Stapelberg
parent 85eb097677
commit 66f2148236
4 changed files with 56 additions and 1 deletions

View File

@ -1841,7 +1841,7 @@ void cmd_swap(I3_CMD, const char *mode, const char *arg) {
return;
}
con = (Con *)target;
con = con_by_con_id(target);
} else if (strcmp(mode, "mark") == 0) {
con = con_by_mark(arg);
} else {