]> git.sur5r.net Git - i3/i3/blobdiff - src/commands.c
Check if con_id exists in cmd_swap (#2898)
[i3/i3] / src / commands.c
index 393d70185e5a8e9e8d779c3ecee657d9fadba459..faee3916ff03ea5e209890785d0bb872c1a87756 100644 (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 {
@@ -1854,7 +1854,7 @@ void cmd_swap(I3_CMD, const char *mode, const char *arg) {
         return;
     }
 
-    if (match == TAILQ_LAST(&owindows, owindows_head)) {
+    if (match != TAILQ_LAST(&owindows, owindows_head)) {
         DLOG("More than one container matched the swap command, only using the first one.");
     }