event: fix ConfigureRequest handling (FS#424)

ConfigureRequest are sent with real X windows size, not fake size with
border and titlebar.
So we need to re-add size of borders and titlebar before calling
client_resize(), otherwise we set a X size the client can considers wrong
and then we start loopin forever since we do not handle its request to
be sized correctly.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-01-10 10:01:51 +01:00
parent 61359d0352
commit d02403e6b9
2 changed files with 5 additions and 0 deletions

View File

@ -730,6 +730,7 @@ client_geometry_hints(client_t *c, area_t geometry)
}
/** Resize client window.
* The sizse given as parameters are with titlebar and borders!
* \param c Client to resize.
* \param geometry New window geometry.
* \param hints Use size hints.

View File

@ -245,6 +245,10 @@ event_handle_configurerequest(void *data __attribute__ ((unused)),
if(ev->value_mask & XCB_CONFIG_WINDOW_HEIGHT)
geometry.height = ev->height;
/** Configure request are sent with size relative to real (internal)
* window size, i.e. without titlebars and borders. */
geometry = titlebar_geometry_add(c->titlebar, c->border, geometry);
if(geometry.x != c->geometry.x || geometry.y != c->geometry.y
|| geometry.width != c->geometry.width || geometry.height != c->geometry.height)
{