Skip to content

Commit

Permalink
added statusall toggle, replacing need for patch
Browse files Browse the repository at this point in the history
  • Loading branch information
garybgenett committed Mar 24, 2014
1 parent b9f79c3 commit d318ffd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ static const float mfact = 0.55; /* factor of master area size [0.05..0.95]
static const int nmaster = 1; /* number of clients in master area */
static const int nviews = 1; /* number of tags highlighted by default */
static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
static const Bool statusall = False;/* True means status is shown in all bars, not just active monitor */

static const int master[1]; /* nmaster override per monitor */
//static const int master[] = {1,-1}; /* monitor 0 = nmaster 1, monitor 1 = no nmaster (all vertical) */
Expand Down
12 changes: 6 additions & 6 deletions dwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ drawbar(Monitor *m) {
drw_text(drw, x, 0, w, bh, custom, 0);
x += w;
xx = x;
if(m == selmon) { /* status is only drawn on selected monitor */
if(m == selmon || statusall) { /* status is only drawn on selected monitor, unless statusall is true */
w = TEXTW(stext);
x = m->ww - w;
if(x < xx) {
Expand Down Expand Up @@ -786,7 +786,7 @@ expose(XEvent *e) {
XExposeEvent *ev = &e->xexpose;

if(ev->count == 0 && (m = wintomon(ev->window)))
drawbar(m);
statusall ? drawbars() : drawbar(m);
}

void
Expand Down Expand Up @@ -1229,7 +1229,7 @@ propertynotify(XEvent *e) {
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
updatetitle(c);
if(c == c->mon->sel)
drawbar(c->mon);
statusall ? drawbars() : drawbar(c->mon);
}
if(ev->atom == netatom[NetWMWindowType])
updatewindowtype(c);
Expand Down Expand Up @@ -1332,7 +1332,7 @@ restack(Monitor *m) {
XEvent ev;
XWindowChanges wc;

drawbar(m);
statusall ? drawbars() : drawbar(m);
if(!m->sel)
return;
if(m->sel->isfloating || !m->lt[m->sellt]->arrange)
Expand Down Expand Up @@ -1482,7 +1482,7 @@ setlayout(const Arg *arg) {
if(selmon->sel)
arrange(selmon);
else
drawbar(selmon);
statusall ? drawbars() : drawbar(selmon);
}

/* arg > 1.0 will set mfact absolutly */
Expand Down Expand Up @@ -1948,7 +1948,7 @@ void
updatestatus(void) {
if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
strcpy(stext, "dwm-"VERSION);
drawbar(selmon);
statusall ? drawbars() : drawbar(selmon);
}

void
Expand Down

0 comments on commit d318ffd

Please sign in to comment.