+#if 0
+ bzero(&wc, sizeof wc);
+ wc.border_width = 1;
+ mask = CWX | CWY | CWBorderWidth;
+
+ win->g.w = wc.width = win->wa.width;
+ win->g.h = wc.height = win->wa.height;
+ win->g.x = wc.x = (ws[current_ws].g.w - win->wa.width) / 2;
+ win->g.y = wc.y = (ws[current_ws].g.h - 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);
+return;
+#endif
+ bzero(&wc, sizeof wc);
+ wc.border_width = 1;
+ mask = CWX | CWY | CWBorderWidth;
+
+ /* use obsolete width height */
+ if (win->sh.flags & USPosition) {
+ win->g.w = wc.width = win->sh.width;
+ win->g.h = 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 < ws[current_ws].g.w / 10)
+ win->sh.min_width = ws[current_ws].g.w / 3;
+ if (win->sh.min_height < ws[current_ws].g.h / 10)
+ win->sh.height = ws[current_ws].g.h / 3;
+
+ win->g.w = wc.width = win->sh.min_width * 2;
+ win->g.h = wc.height = win->sh.min_height * 2;
+ mask |= CWWidth | CWHeight;
+ }
+ if (win->sh.flags & PMaxSize) {
+ /* potentially override min values */
+ if (win->sh.max_width < ws[current_ws].g.w) {
+ win->g.w = wc.width = win->sh.max_width;
+ mask |= CWWidth;
+ }
+ if (win->sh.max_height < ws[current_ws].g.h) {
+ win->g.h = wc.height = win->sh.max_height;
+ mask |= CWHeight;
+ }
+ }
+
+ /* make sure we don't clobber the screen */
+ if ((mask & CWWidth) && win->wa.width > ws[current_ws].g.w)
+ win->wa.width = ws[current_ws].g.w - 4;
+ if ((mask & CWHeight) && win->wa.height > ws[current_ws].g.h)
+ win->wa.height = ws[current_ws].g.h - 4;
+
+ /* supposed to be obsolete */
+ if (win->sh.flags & USPosition) {
+ win->g.x = wc.x = win->sh.x;
+ win->g.y = wc.y = win->sh.y;
+ } else {
+ win->g.x = wc.x = (ws[current_ws].g.w - win->wa.width) / 2;
+ win->g.y = wc.y = (ws[current_ws].g.h - 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);