Use the original geometry for floating windows

This commit is contained in:
Michael Stapelberg
2011-03-03 16:22:22 +01:00
parent b484b9ab32
commit caa1ac1a9f
3 changed files with 62 additions and 8 deletions

View File

@ -254,16 +254,15 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
if (cwindow->dock)
want_floating = false;
/* Store the requested geometry. The width/height gets raised to at least
* 75x50 when entering floating mode, which is the minimum size for a
* window to be useful (smaller windows are usually overlays/toolbars/…
* which are not managed by the wm anyways). We store the original geometry
* here because its used for dock clients. */
nc->geometry = (Rect){ geom->x, geom->y, geom->width, geom->height };
if (want_floating) {
nc->rect.x = geom->x;
nc->rect.y = geom->y;
/* We respect the geometry wishes of floating windows, as long as they
* are bigger than our minimal useful size (75x50). */
nc->rect.width = max(geom->width, 75);
nc->rect.height = max(geom->height, 50);
DLOG("geometry = %d x %d\n", nc->rect.width, nc->rect.height);
DLOG("geometry = %d x %d\n", nc->geometry.width, nc->geometry.height);
floating_enable(nc, false);
}