- also do this after applying the startup state so maximize and fullscreen
- will get the right sizes and positions if the client is starting with
- those states
- */
- client_configure(self, placex, placey,
- self->area.width, self->area.height,
- self->border_width,
- FALSE, TRUE);
+ /* shrink by the frame's area */
+ a->width -= self->frame->size.left + self->frame->size.right;
+ a->height -= self->frame->size.top + self->frame->size.bottom;
+
+ /* fit the window inside the area */
+ if (placew > a->width || self->area.height > a->height) {
+ placew = MIN(self->area.width, a->width);
+ placeh = MIN(self->area.height, a->height);
+
+ ob_debug("setting window size to %dx%d\n",
+ self->area.width, self->area.height);
+ }
+ g_free(a);
+ }
+
+
+ ob_debug("placing window 0x%x at %d, %d with size %d x %d. "
+ "some restrictions may apply\n",
+ self->window, placex, placey, placew, placeh);
+ if (self->session)
+ ob_debug(" but session requested %d, %d %d x %d instead, "
+ "overriding\n",
+ self->session->x, self->session->y,
+ self->session->w, self->session->h);
+
+ /* do this after the window is placed, so the premax/prefullscreen numbers
+ won't be all wacko!!