From: Michael Stapelberg Date: Tue, 10 Feb 2009 01:03:58 +0000 (+0100) Subject: Implement more moving X-Git-Tag: 3.a~214 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=586647965c5ff50bd782c0076b8df44eb50cdabb;p=i3%2Fi3 Implement more moving --- diff --git a/mainx.c b/mainx.c index c743e74b..152850c4 100644 --- a/mainx.c +++ b/mainx.c @@ -667,8 +667,7 @@ static void move_current_window(xcb_connection_t *connection, direction_t direct if (current_col == 0) return; - new = table[current_col-1][current_row]; - new_current_col--; + new = table[--new_current_col][current_row]; break; case D_RIGHT: printf("ok, moving right\n"); @@ -677,11 +676,9 @@ static void move_current_window(xcb_connection_t *connection, direction_t direct expand_table_cols(); } - new = table[current_col+1][current_row]; - new_current_col++; + new = table[++new_current_col][current_row]; break; case D_UP: - /* TODO: impl */ printf("moving up\n"); Client *prev = CIRCLEQ_PREV(current_client, clients); if (prev != CIRCLEQ_END(&(container->clients))) { @@ -693,8 +690,11 @@ static void move_current_window(xcb_connection_t *connection, direction_t direct return; } - /* TODO: push the client into the container above */ - return; + if (current_row == 0) + return; + + new = table[current_col][--new_current_row]; + break; case D_DOWN: printf("moving down\n"); Client *next = CIRCLEQ_NEXT(current_client, clients); @@ -712,13 +712,9 @@ static void move_current_window(xcb_connection_t *connection, direction_t direct if (current_row == (table_dims.y-1)) { printf("creating a new container\n"); expand_table_rows(); - new = table[current_col][current_row+1]; - new_current_row++; } - /* TODO: check if there is another container below and move - it there */ - + new = table[current_col][++new_current_row]; break; }