]> git.sur5r.net Git - i3/i3/commitdiff
Bugfixes in window placement
authorMichael Stapelberg <michael+git@stapelberg.de>
Wed, 11 Feb 2009 15:12:03 +0000 (16:12 +0100)
committerMichael Stapelberg <michael+git@stapelberg.de>
Wed, 11 Feb 2009 15:12:03 +0000 (16:12 +0100)
mainx.c

diff --git a/mainx.c b/mainx.c
index c3022f7632148ba2c2c293a6ae2ff50b8e88d00f..6e205518f39614ada9c8223442ab717990a04ddb 100644 (file)
--- a/mainx.c
+++ b/mainx.c
@@ -459,8 +459,8 @@ void render_container(xcb_connection_t *connection, Container *container) {
                         * add a border of 2 pixel to each value */
                        values[0] = 2;
                        values[1] = font->height + 2 + 2;
-                       values[2] -= values[0] + 2;
-                       values[3] -= values[1] + 2;
+                       values[2] = client->width - (values[0] + 2);
+                       values[3] = client->height - (values[1] + 2);
                        printf("child itself will be at %dx%d with size %dx%d\n",
                                        values[0], values[1], values[2], values[3]);
 
@@ -518,6 +518,8 @@ void reparent_window(xcb_connection_t *conn, xcb_window_t child,
        if (new == NULL) {
                printf("oh, it's new\n");
                new = calloc(sizeof(Client), 1);
+               new->x = -1;
+               new->y = -1;
        }
        uint32_t mask = 0;
        uint32_t values[3];