]> git.sur5r.net Git - i3/i3/blobdiff - src/scratchpad.c
Bugfix: Correctly handle 'move scratchpad' on workspace level (+test) (Thanks mseed)
[i3/i3] / src / scratchpad.c
index 9fceb2d744278eeafdf0a1a65dfde6906399a96e..b00d7f616e88b24f63047ec8735178cc4807035e 100644 (file)
  *
  */
 void scratchpad_move(Con *con) {
+    if (con->type == CT_WORKSPACE) {
+        LOG("'move scratchpad' used on a workspace \"%s\". Calling it "
+            "recursively on all windows on this workspace.\n", con->name);
+        Con *current;
+        current = TAILQ_FIRST(&(con->focus_head));
+        while (current) {
+            Con *next = TAILQ_NEXT(current, focused);
+            scratchpad_move(current);
+            current = next;
+        }
+        return;
+    }
     DLOG("should move con %p to __i3_scratch\n", con);
 
     Con *__i3_scratch = workspace_get("__i3_scratch", NULL);