From 74e729c5b6b391c4cf0aba1c14bd0377dea178d1 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 11 Feb 2009 16:12:03 +0100 Subject: [PATCH] Bugfixes in window placement --- mainx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mainx.c b/mainx.c index c3022f76..6e205518 100644 --- 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]; -- 2.39.5