diff --git a/bar/systray.c b/bar/systray.c index 288094b..49d196b 100644 --- a/bar/systray.c +++ b/bar/systray.c @@ -10,7 +10,7 @@ width_systray(Bar *bar, BarWidthArg *a) if (!systray) return 1; if (!selmon->hidesystray) { - for (i = systray->icons; i; w += i->w + systrayspacing, i = i->next); + for (i = systray->icons; i; w += i->w + systrayspacing, i = i->next) {}; return w ? w + lrpad - systrayspacing : 0; } else { return 0; diff --git a/bar/title.c b/bar/title.c index 2e58e90..7d95dec 100644 --- a/bar/title.c +++ b/bar/title.c @@ -58,7 +58,7 @@ draw_title(Bar *bar, BarDrawArg *a) if (!selmon->hideunselectedtitle) drw_setscheme(drw, scheme[scm]); #if USEWINICON if (!selmon->hideicon) { - drw_text(drw, x, 0, tabw + (i < remainder ? 1 : 0), bh, padding + (c->name ? c->icw + iconspacing : 0), c->name, 0, False); + drw_text(drw, x, 0, tabw + (i < remainder ? 1 : 0), bh, padding + (c->icw + iconspacing), c->name, 0, False); } else { drw_text(drw, x, 0, tabw + (i < remainder ? 1 : 0), bh, padding, c->name, 0, False); } diff --git a/speedwm.c b/speedwm.c index 5d562db..41ba3ee 100644 --- a/speedwm.c +++ b/speedwm.c @@ -213,17 +213,6 @@ typedef struct { int rel_h; } BarClickArg; -typedef struct { - int monitor; - int bar; - int alignment; // see bar alignment enum - int (*widthfunc)(Bar *bar, BarWidthArg *a); - int (*drawfunc)(Bar *bar, BarDrawArg *a); - int (*clickfunc)(Bar *bar, Arg *arg, BarClickArg *a); - char *name; // for debugging - int x, w; // position, width for internal use -} BarRule; - typedef struct { unsigned int click; unsigned int mask; @@ -234,7 +223,7 @@ typedef struct { typedef struct Client Client; struct Client { - char name[256]; /* window manager name */ + char name[256]; /* client */ float mina, maxa; float cfact; /* cfact for the client */ int x, y, w, h; /* x/y position, width and height */ @@ -274,6 +263,17 @@ struct Client { #endif }; +typedef struct { + int monitor; + int bar; + int alignment; // see bar alignment enum + int (*widthfunc)(Bar *bar, BarWidthArg *a); + int (*drawfunc)(Bar *bar, BarDrawArg *a); + int (*clickfunc)(Bar *bar, Arg *arg, BarClickArg *a); + char *name; // for debugging + int x, w; // position, width for internal use +} BarRule; + typedef struct { int type; unsigned int mod; @@ -1749,7 +1749,7 @@ createmon(void) m->tagplshape = tagplshape; /* monitor index */ - for (mi = 0, mon = mons; mon; mon = mon->next, mi++); + for (mi = 0, mon = mons; mon; mon = mon->next, mi++) {}; /* coloring */ m->colorselectedtitle = colorselectedtitle; @@ -2725,14 +2725,11 @@ handlexevent(struct epoll_event *ev) void incmastercount(const Arg *arg) { - Client *c; - int n; - for (n = 0, c = nexttiled(selmon->clients); c; c = nexttiled(c->next), n++); - if (i3mastercount) { - selmon->mastercount = selmon->pertag->mastercounts[selmon->pertag->curtag] = MIN(!selmon->mastercount,n); - } else { - selmon->mastercount = selmon->pertag->mastercounts[selmon->pertag->curtag] = MAX(MIN(selmon->mastercount,n) + arg->i, 0); - } + if (i3mastercount) { + selmon->mastercount = selmon->pertag->mastercounts[selmon->pertag->curtag] = !selmon->mastercount; + } else { + selmon->mastercount = selmon->pertag->mastercounts[selmon->pertag->curtag] = MAX(selmon->mastercount + arg->i, 0); + } arrange(selmon); } @@ -5025,10 +5022,7 @@ setlayout(const Arg *arg) selmon->pertag->ltaxis[selmon->pertag->curtag][stack] = selmon->ltaxis[stack]; selmon->pertag->ltaxis[selmon->pertag->curtag][stack2] = selmon->ltaxis[stack2]; - if (selmon->sel) - arrange(selmon); - else - drawbaritems(selmon); + arrange(selmon); } void