/* Configuration */
static int border = 2;
static int no_capture = 0;
+static int stack = 25;
/* Internal structures */
struct win_sys {
else if (type == UnmapNotify) {
if ((win = win_find(dpy,xe->xunmap.window,0)) &&
win->state != ST_HIDE) {
- if (!strut_del(root, win))
- wm_remove(win);
- else
- wm_update();
+ strut_del(root, win);
+ wm_remove(win);
win->state = ST_HIDE;
}
}
if (win_prop(win, NET_STATE) == atoms[NET_FULL])
win->state = ST_FULL;
XSelectInput(win->sys->dpy, win->sys->xid, PropertyChangeMask);
- if (!strut_add(root, win))
- wm_insert(win);
- else
- wm_update();
+ if (strut_add(root, win))
+ win->type = TYPE_TOOLBAR;
+ wm_insert(win);
}
sys_show(win, win->state);
}
break;
case ST_SHADE:
printf("sys_show: shade %p\n", win);
+ XConfigureWindow(win->sys->dpy, win->sys->xid, CWHeight,
+ &(XWindowChanges){ .height = stack });
XMapWindow(win->sys->dpy, win->sys->xid);
break;
case ST_ICON:
Window xid;
/* Load configuration */
+ stack = conf_get_int("main.stack", stack);
border = conf_get_int("main.border", border);
no_capture = conf_get_int("main.no-capture", no_capture);
&par, &xid, &kids, &nkids)) {
for(int i = 0; i < nkids; i++) {
win_t *win = win_find(root->sys->dpy, kids[i], 1);
- if (win && win_viewable(win) && !strut_add(root,win))
+ if (win && win_viewable(win)) {
+ if (strut_add(root,win))
+ win->type = TYPE_TOOLBAR;
wm_insert(win);
+ }
}
XFree(kids);
}
- wm_update(); // For struts
}
/* Main loop */