added pertag patch
[dwm.git] / dwm.c.rej
1 --- dwm.c
2 +++ dwm.c
3 @@ -527,6 +563,7 @@ cleanup(void) {
4 XFreeFont(dpy, dc.font.xfont);
5 XUngrabKey(dpy, AnyKey, AnyModifier, root);
6 XFreePixmap(dpy, dc.drawable);
7 + XFreePixmap(dpy, dc.tabdrawable);
8 XFreeGC(dpy, dc.gc);
9 XFreeCursor(dpy, cursor[CurNormal]);
10 XFreeCursor(dpy, cursor[CurResize]);
11 @@ -619,9 +658,13 @@ configurenotify(XEvent *e) {
12 if(dc.drawable != 0)
13 XFreePixmap(dpy, dc.drawable);
14 dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
15 + if(dc.tabdrawable != 0)
16 + XFreePixmap(dpy, dc.tabdrawable);
17 + dc.tabdrawable = XCreatePixmap(dpy, root, sw, th, DefaultDepth(dpy, screen));
18 updatebars();
19 - for(m = mons; m; m = m->next)
20 + for(m = mons; m; m = m->next){
21 XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
22 + }
23 focus(NULL);
24 arrange(NULL);
25 }
26 @@ -925,13 +1070,14 @@ drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
27 XDrawRectangle(dpy, dc.drawable, dc.gc, dc.x+1, dc.y+1, x, x);
28 }
29
30 +
31 void
32 -drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
33 +drawtext(Drawable drawable, const char *text, unsigned long col[ColLast], Bool invert) {
34 char buf[256];
35 int i, x, y, h, len, olen;
36
37 XSetForeground(dpy, dc.gc, col[invert ? ColFG : ColBG]);
38 - XFillRectangle(dpy, dc.drawable, dc.gc, dc.x, dc.y, dc.w, dc.h);
39 + XFillRectangle(dpy, drawable, dc.gc, dc.x, dc.y, dc.w, dc.h);
40 if(!text)
41 return;
42 olen = strlen(text);
43 @@ -947,11 +1093,12 @@ drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
44 for(i = len; i && i > len - 3; buf[--i] = '.');
45 XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
46 if(dc.font.set)
47 - XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
48 + XmbDrawString(dpy, drawable, dc.font.set, dc.gc, x, y, buf, len);
49 else
50 - XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
51 + XDrawString(dpy, drawable, dc.gc, x, y, buf, len);
52 }
53
54 +
55 void
56 enternotify(XEvent *e) {
57 Client *c;
58 @@ -1779,6 +1946,7 @@ setup(void) {
59 dc.sel[ColBG] = getcolor(selbgcolor);
60 dc.sel[ColFG] = getcolor(selfgcolor);
61 dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
62 + dc.tabdrawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), th, DefaultDepth(dpy, screen));
63 dc.gc = XCreateGC(dpy, root, 0, NULL);
64 XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
65 if(!dc.font.set)