From 81ff1f976df43ebda6fdcfb794f926b5d14f3364 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 21 Jan 2011 21:01:02 +0100 Subject: [PATCH] =?utf8?q?Bugfix:=20Don=E2=80=99t=20send=20fake=20configur?= =?utf8?q?e=20notify=20with=20not=20yet=20rendered=20rect=20for=20floating?= =?utf8?q?=20windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes a bug where opening the Xpdf find dialog when Xpdf is in fullscreen mode would crash Xpdf due to a zero-width and zero-height ConfigureNotify rect. --- src/floating.c | 6 ++++++ src/xcb.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/floating.c b/src/floating.c index 3cf8ab5f..85b2c0ae 100644 --- a/src/floating.c +++ b/src/floating.c @@ -87,12 +87,14 @@ void floating_enable(Con *con, bool automatic) { i3Font *font = load_font(conn, config.font); int deco_height = font->height + 5; + DLOG("Original rect: (%d, %d) with %d x %d\n", con->rect.x, con->rect.y, con->rect.width, con->rect.height); nc->rect = con->rect; /* add pixels for the decoration */ /* TODO: don’t add them when the user automatically puts new windows into * 1pixel/borderless mode */ nc->rect.height += deco_height + 4; nc->rect.width += 4; + DLOG("Floating rect: (%d, %d) with %d x %d\n", nc->rect.x, nc->rect.y, nc->rect.width, nc->rect.height); nc->orientation = NO_ORIENTATION; nc->type = CT_FLOATING_CON; TAILQ_INSERT_TAIL(&(nc->parent->floating_head), nc, floating_windows); @@ -120,6 +122,10 @@ void floating_enable(Con *con, bool automatic) { } } + /* render the cons to get initial window_rect correct */ + render_con(nc, false); + render_con(con, false); + TAILQ_INSERT_TAIL(&(nc->nodes_head), con, nodes); TAILQ_INSERT_TAIL(&(nc->focus_head), con, focused); // TODO: don’t influence focus handling when Con was not focused before. diff --git a/src/xcb.c b/src/xcb.c index 4b400ae5..ff7dadbc 100644 --- a/src/xcb.c +++ b/src/xcb.c @@ -192,6 +192,8 @@ void fake_absolute_configure_notify(Con *con) { absolute.width = con->window_rect.width; absolute.height = con->window_rect.height; + DLOG("fake rect = (%d, %d, %d, %d)\n", absolute.x, absolute.y, absolute.width, absolute.height); + fake_configure_notify(conn, absolute, con->window->id); } -- 2.39.5