if (bar_enabled == 0)
return;
-
if (bar_extra && bar_extra_running) {
/* ignore short reads; it'll correct itself */
while ((b = fgetln(stdin, &len)) != NULL)
XMapRaised(display, tmpr->bar_window);
}
bar_enabled = !bar_enabled;
- XSync(display, False);
for (i = 0; i < sc; i++)
for (j = 0; j < SWM_WS_MAX; j++)
screens[i].ws[j].restack = 1;
stack();
/* must be after stack */
- for (i = 0; i < sc; i++)
- TAILQ_FOREACH(tmpr, &screens[i].rl, entry)
- bar_update();
+ bar_update();
}
void
XWindowChanges wc;
struct swm_geometry win_g, r_g = *g;
struct ws_win *win, *winfocus;
- int i, j, s, w_inc, h_inc, w_base, h_base, stacks;
- int hrh, extra, h_slice, last_h = 0;
+ int i, j, s, stacks;
+ int w_inc = 1, h_inc, w_base = 1, h_base;
+ int hrh, extra = 0, h_slice, last_h = 0;
int split, colno, winno, mwin, msize, mscale;
int remain, missing, v_slice;;
unsigned int mask;
ws->focus = TAILQ_FIRST(&ws->winlist);
winfocus = cur_focus ? cur_focus : ws->focus;
- win = TAILQ_FIRST(&ws->winlist);
+ TAILQ_FOREACH(win, &ws->winlist, entry)
+ if (win->transient == 0 && win->floating == 0)
+ break;
+
+ if (win == NULL)
+ goto notiles;
+
if (rot) {
w_inc = win->sh.width_inc;
w_base = win->sh.base_width;
/* adjust for window's requested size increment */
remain = (win_g.w - w_base) % w_inc;
missing = w_inc - remain;
-
- if (missing <= extra || j == 0) {
- extra -= missing;
- win_g.w += missing;
- } else {
- win_g.w -= remain;
- extra += remain;
- }
+ win_g.w -= remain;
+ extra += remain;
}
msize = win_g.w;
j++;
}
+ notiles:
/* now, stack all the floaters and transients */
TAILQ_FOREACH(win, &ws->winlist, entry) {
if (win->transient == 0 && win->floating == 0)
r->ws = ws;
ws->r = r;
TAILQ_INSERT_TAIL(&s->rl, r, entry);
- bar_setup(r);
}
void
main(int argc, char *argv[])
{
struct passwd *pwd;
+ struct swm_region *r;
char conf[PATH_MAX], *cfile = NULL;
struct stat sb;
XEvent e;
- int xfd;
+ int xfd, i;
fd_set rd;
start_argv = argv;
}
if (cfile)
conf_load(cfile);
- bar_refresh();
+
+ /* setup all bars */
+ for (i = 0; i < ScreenCount(display); i++)
+ TAILQ_FOREACH(r, &screens[i].rl, entry)
+ bar_setup(r);
/* ws[0].focus = TAILQ_FIRST(&ws[0].winlist); */