- if (self->iconic) {
- self->iconic = FALSE;
- client_iconify(self, TRUE, FALSE, TRUE);
- }
- if (self->fullscreen) {
- self->fullscreen = FALSE;
- client_fullscreen(self, TRUE);
- }
- if (self->undecorated) {
- self->undecorated = FALSE;
- client_set_undecorated(self, TRUE);
- }
- if (self->shaded) {
- self->shaded = FALSE;
+ /* move the client to its placed position, or it it's already there,
+ generate a ConfigureNotify telling the client where it is.
+
+ do this after adjusting the frame. otherwise it gets all weird and
+ clients don't work right
+
+ do this before applying the states so they have the correct
+ pre-max/pre-fullscreen values
+ */
+ client_try_configure(self, &x, &y, &w, &h, &l, &l, FALSE);
+ ob_debug("placed window 0x%x at %d, %d with size %d x %d\n",
+ self->window, x, y, w, h);
+ /* save the area, and make it where it should be for the premax stuff */
+ oldarea = self->area;
+ RECT_SET(self->area, x, y, w, h);
+
+ /* apply the states. these are in a carefully crafted order.. */
+
+ if (iconic)
+ client_iconify(self, TRUE, FALSE, TRUE);
+ if (fullscreen)
+ client_fullscreen(self, TRUE);
+ if (undecorated)
+ client_set_undecorated(self, TRUE);
+ if (shaded)