+stack_floater(struct ws_win *win)
+{
+ unsigned int mask;
+ XWindowChanges wc;
+
+ bzero(&wc, sizeof wc);
+ wc.border_width = 1;
+ mask = CWX | CWY | CWBorderWidth;
+
+ /* use obsolete width height */
+ if (win->sh.flags & USPosition) {
+ win->width = wc.width = win->sh.width;
+ win->height = wc.height = win->sh.height;
+ mask |= CWWidth | CWHeight;
+ }
+
+ /* try min max */
+ if (win->sh.flags & PMinSize) {
+ /* some hints are retarded */
+ if (win->sh.min_width < width / 10)
+ win->sh.min_width = width / 3;
+ if (win->sh.min_height < height / 10)
+ win->wa.height = height / 3;
+
+ win->width = wc.width = win->sh.min_width * 2;
+ win->height = wc.height = win->sh.min_height * 2;
+ mask |= CWWidth | CWHeight;
+ }
+ if (win->sh.flags & PMaxSize) {
+ /* potentially override min values */
+ if (win->sh.max_width < width) {
+ win->width = wc.width = win->sh.max_width;
+ mask |= CWWidth;
+ }
+ if (win->sh.max_height < height) {
+ win->height = wc.height = win->sh.max_height;
+ mask |= CWHeight;
+ }
+ }
+
+ /* make sure we don't clobber the screen */
+ if ((mask & CWWidth) && win->wa.width > width)
+ win->wa.width = width - 4;
+ if ((mask & CWHeight) && win->wa.height > height)
+ win->wa.height = height - 4;
+
+ /* supposed to be obsolete */
+ if (win->sh.flags & USPosition) {
+ win->x = wc.x = win->sh.x;
+ win->y = wc.y = win->sh.y;
+ } else {
+ win->x = wc.x = (width - win->wa.width) / 2;
+ win->y = wc.y = (height - win->wa.height) / 2;
+ }
+ DNPRINTF(SWM_D_EVENT, "stack_floater: win %d x %d y %d w %d h %d\n",
+ win, wc.x, wc.y, wc.width, wc.height);
+
+ XConfigureWindow(display, win->id, mask, &wc);
+}
+
+void