+void
+stack_floater(struct ws_win *win)
+{
+ unsigned int mask;
+ XWindowChanges wc;
+
+#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);
+}
+
+
+int vertical_msize[SWM_WS_MAX];
+
+void
+vertical_init(int ws_idx)
+{
+ DNPRINTF(SWM_D_MISC, "vertical_init: workspace: %d\n", current_ws);
+
+ vertical_msize[ws_idx] = ws[ws_idx].g.w / 2;
+}
+
+void
+vertical_resize(int id)
+{
+ DNPRINTF(SWM_D_MISC, "vertical_resize: workspace: %d\n", current_ws);
+
+ switch (id) {
+ case SWM_ARG_ID_MASTERSHRINK:
+ vertical_msize[current_ws] -= ws[current_ws].g.w / 32;
+ if ( vertical_msize[current_ws] < ws[current_ws].g.w / 16)
+ vertical_msize[current_ws] = ws[current_ws].g.w / 16;
+ break;
+ case SWM_ARG_ID_MASTERGROW:
+ vertical_msize[current_ws] += ws[current_ws].g.w / 32;
+ if ( vertical_msize[current_ws] >
+ (ws[current_ws].g.w - (ws[current_ws].g.w / 16)))
+ vertical_msize[current_ws] =
+ ws[current_ws].g.w - ws[current_ws].g.w / 16;
+ break;
+ default: