]> git.sur5r.net Git - i3/i3/blobdiff - src/commands.c
Always auto center on 'scratchpad show' if window hasn't been repositioned by the...
[i3/i3] / src / commands.c
index 0fbf26cfd5045cf88c4e03de2a353d9db01446f3..2404a811785591fd996c8ed37b815e0bdc252a37 100644 (file)
@@ -588,10 +588,14 @@ static void cmd_resize_floating(I3_CMD, char *way, char *direction, Con *floatin
         return;
 
     if (strcmp(direction, "up") == 0) {
-        floating_con->rect.y -= px;
+        floating_con->rect.y -= (floating_con->rect.height - old_rect.height);
     } else if (strcmp(direction, "left") == 0) {
-        floating_con->rect.x -= px;
+        floating_con->rect.x -= (floating_con->rect.width - old_rect.width);
     }
+
+    /* If this is a scratchpad window, don't auto center it from now on. */
+    if (floating_con->scratchpad_state == SCRATCHPAD_FRESH)
+        floating_con->scratchpad_state = SCRATCHPAD_CHANGED;
 }
 
 static bool cmd_resize_tiling_direction(I3_CMD, Con *current, char *way, char *direction, int ppt) {