aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-06-19 14:07:55 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-06-19 14:07:55 +0100
commit6e0ce46365fb9a19c6b6e70d3039f3cbe53ec1db (patch)
treed1f7ac9e2c69d246414d7ce3514c2b9559e45059
parentc853d5e9bbc9bec5880aabaf3c30d4ab0a0d981a (diff)
use sel instead of seeking the list
-rw-r--r--dwm.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/dwm.c b/dwm.c
index 5211ece..a94cacc 100644
--- a/dwm.c
+++ b/dwm.c
@@ -481,19 +481,17 @@ detachstack(Client *c) {
void
drawbar(void) {
int i, x;
- Client *c;
dc.x = 0;
- for(c = stack; c && c->isbanned; c = c->snext);
for(i = 0; i < LENGTH(tags); i++) {
dc.w = TEXTW(tags[i]);
if(tagset[seltags] & 1 << i) {
drawtext(tags[i], dc.sel, isurgent(i));
- drawsquare(c && c->tags & 1 << i, isoccupied(i), isurgent(i), dc.sel);
+ drawsquare(sel && sel->tags & 1 << i, isoccupied(i), isurgent(i), dc.sel);
}
else {
drawtext(tags[i], dc.norm, isurgent(i));
- drawsquare(c && c->tags & 1 << i, isoccupied(i), isurgent(i), dc.norm);
+ drawsquare(sel && sel->tags & 1 << i, isoccupied(i), isurgent(i), dc.norm);
}
dc.x += dc.w;
}
@@ -513,9 +511,9 @@ drawbar(void) {
drawtext(stext, dc.norm, False);
if((dc.w = dc.x - x) > bh) {
dc.x = x;
- if(c) {
- drawtext(c->name, dc.sel, False);
- drawsquare(c->isfixed, c->isfloating, False, dc.sel);
+ if(sel) {
+ drawtext(sel->name, dc.sel, False);
+ drawsquare(sel->isfixed, sel->isfloating, False, dc.sel);
}
else
drawtext(NULL, dc.norm, False);