Bugfix: Don’t send fake configure notify with not yet rendered rect for floating windows

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.
next
Michael Stapelberg 2011-01-21 21:01:02 +01:00
parent 1fecbb3e5a
commit 81ff1f976d
2 changed files with 8 additions and 0 deletions

View File

@ -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: dont 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: dont influence focus handling when Con was not focused before.

View File

@ -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);
}