]> git.sur5r.net Git - i3/i3/blobdiff - src/scratchpad.c
Merge branch 'next'
[i3/i3] / src / scratchpad.c
index d6c1a09e1d630e92eec364c125c9e4e2389a485e..17df77dde624804e642a0934c9157a06bef07e18 100644 (file)
@@ -66,7 +66,13 @@ void scratchpad_move(Con *con) {
      * adjusted in size according to what the user specifies. */
     if (con->scratchpad_state == SCRATCHPAD_NONE) {
         DLOG("This window was never used as a scratchpad before.\n");
-        con->scratchpad_state = SCRATCHPAD_FRESH;
+        if (con == maybe_floating_con) {
+            DLOG("It was in floating mode before, set scratchpad state to changed.\n");
+            con->scratchpad_state = SCRATCHPAD_CHANGED;
+        } else {
+            DLOG("It was in tiling mode before, set scratchpad state to fresh.\n");
+            con->scratchpad_state = SCRATCHPAD_FRESH;
+        }
     }
 }
 
@@ -175,6 +181,10 @@ void scratchpad_show(Con *con) {
             LOG("Use 'move scratchpad' to move a window to the scratchpad.\n");
             return;
         }
+    } else {
+        /* We used a criterion, so we need to do what follows (moving,
+         * resizing) on the floating parent. */
+        con = con_inside_floating(con);
     }
 
     /* 1: Move the window from __i3_scratch to the current workspace. */