diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-01-15 12:04:25 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-01-15 12:04:25 +0100 |
| commit | f8181f64e2ba4fca4e85036c48cf90a2151794fc (patch) | |
| tree | 7d82e76b3214ca5e09a25ce8e68f1fbf1491c138 | |
| parent | implemented new color scheme accordingly to Sanders proposal (diff) | |
| download | dwm-f8181f64e2ba4fca4e85036c48cf90a2151794fc.tar.gz dwm-f8181f64e2ba4fca4e85036c48cf90a2151794fc.zip | |
removed drawclient and drawall (they performed useless operations/consumed useless cpu cycles)
Diffstat (limited to '')
| -rw-r--r-- | client.c | 5 | ||||
| -rw-r--r-- | draw.c | 20 | ||||
| -rw-r--r-- | dwm.h | 2 | ||||
| -rw-r--r-- | event.c | 8 | ||||
| -rw-r--r-- | view.c | 1 |
5 files changed, 6 insertions, 30 deletions
| @@ -90,7 +90,7 @@ focus(Client *c) { | |||
| 90 | sel = c; | 90 | sel = c; |
| 91 | if(old) { | 91 | if(old) { |
| 92 | grabbuttons(old, False); | 92 | grabbuttons(old, False); |
| 93 | drawclient(old); | 93 | XSetWindowBorder(dpy, old->win, dc.norm[ColBorder]); |
| 94 | } | 94 | } |
| 95 | } | 95 | } |
| 96 | if(c) { | 96 | if(c) { |
| @@ -98,11 +98,12 @@ focus(Client *c) { | |||
| 98 | c->snext = stack; | 98 | c->snext = stack; |
| 99 | stack = c; | 99 | stack = c; |
| 100 | grabbuttons(c, True); | 100 | grabbuttons(c, True); |
| 101 | drawclient(c); | 101 | XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); |
| 102 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); | 102 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); |
| 103 | } | 103 | } |
| 104 | else | 104 | else |
| 105 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); | 105 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); |
| 106 | drawstatus(); | ||
| 106 | } | 107 | } |
| 107 | 108 | ||
| 108 | Client * | 109 | Client * |
| @@ -98,15 +98,6 @@ drawtext(const char *text, unsigned long col[ColLast], Bool filledsquare, Bool e | |||
| 98 | /* extern */ | 98 | /* extern */ |
| 99 | 99 | ||
| 100 | void | 100 | void |
| 101 | drawall(void) { | ||
| 102 | Client *c; | ||
| 103 | |||
| 104 | for(c = clients; c; c = getnext(c->next)) | ||
| 105 | drawclient(c); | ||
| 106 | drawstatus(); | ||
| 107 | } | ||
| 108 | |||
| 109 | void | ||
| 110 | drawstatus(void) { | 101 | drawstatus(void) { |
| 111 | int i, x; | 102 | int i, x; |
| 112 | 103 | ||
| @@ -137,17 +128,6 @@ drawstatus(void) { | |||
| 137 | XSync(dpy, False); | 128 | XSync(dpy, False); |
| 138 | } | 129 | } |
| 139 | 130 | ||
| 140 | void | ||
| 141 | drawclient(Client *c) { | ||
| 142 | if(c == sel && issel) { | ||
| 143 | drawstatus(); | ||
| 144 | XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); | ||
| 145 | return; | ||
| 146 | } | ||
| 147 | XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); | ||
| 148 | XSync(dpy, False); | ||
| 149 | } | ||
| 150 | |||
| 151 | unsigned long | 131 | unsigned long |
| 152 | getcolor(const char *colstr) { | 132 | getcolor(const char *colstr) { |
| 153 | Colormap cmap = DefaultColormap(dpy, screen); | 133 | Colormap cmap = DefaultColormap(dpy, screen); |
| @@ -117,9 +117,7 @@ extern void updatetitle(Client *c); /* update the name of c */ | |||
| 117 | extern void unmanage(Client *c); /* destroy c */ | 117 | extern void unmanage(Client *c); /* destroy c */ |
| 118 | 118 | ||
| 119 | /* draw.c */ | 119 | /* draw.c */ |
| 120 | extern void drawall(void); /* draw all visible client titles and the bar */ | ||
| 121 | extern void drawstatus(void); /* draw the bar */ | 120 | extern void drawstatus(void); /* draw the bar */ |
| 122 | extern void drawclient(Client *c); /* draw title and set border of c */ | ||
| 123 | extern unsigned long getcolor(const char *colstr); /* return color of colstr */ | 121 | extern unsigned long getcolor(const char *colstr); /* return color of colstr */ |
| 124 | extern void setfont(const char *fontstr); /* set the font for DC */ | 122 | extern void setfont(const char *fontstr); /* set the font for DC */ |
| 125 | extern unsigned int textw(const char *text); /* return the width of text in px*/ | 123 | extern unsigned int textw(const char *text); /* return the width of text in px*/ |
| @@ -235,7 +235,6 @@ enternotify(XEvent *e) { | |||
| 235 | else if(ev->window == root) { | 235 | else if(ev->window == root) { |
| 236 | issel = True; | 236 | issel = True; |
| 237 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); | 237 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); |
| 238 | drawall(); | ||
| 239 | } | 238 | } |
| 240 | } | 239 | } |
| 241 | 240 | ||
| @@ -272,10 +271,8 @@ static void | |||
| 272 | leavenotify(XEvent *e) { | 271 | leavenotify(XEvent *e) { |
| 273 | XCrossingEvent *ev = &e->xcrossing; | 272 | XCrossingEvent *ev = &e->xcrossing; |
| 274 | 273 | ||
| 275 | if((ev->window == root) && !ev->same_screen) { | 274 | if((ev->window == root) && !ev->same_screen) |
| 276 | issel = False; | 275 | issel = False; |
| 277 | drawall(); | ||
| 278 | } | ||
| 279 | } | 276 | } |
| 280 | 277 | ||
| 281 | static void | 278 | static void |
| @@ -329,7 +326,8 @@ propertynotify(XEvent *e) { | |||
| 329 | } | 326 | } |
| 330 | if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { | 327 | if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { |
| 331 | updatetitle(c); | 328 | updatetitle(c); |
| 332 | drawclient(c); | 329 | if(c == sel) |
| 330 | drawstatus(); | ||
| 333 | } | 331 | } |
| 334 | } | 332 | } |
| 335 | } | 333 | } |
| @@ -200,7 +200,6 @@ restack(void) { | |||
| 200 | XLowerWindow(dpy, c->win); | 200 | XLowerWindow(dpy, c->win); |
| 201 | } | 201 | } |
| 202 | } | 202 | } |
| 203 | drawall(); | ||
| 204 | XSync(dpy, False); | 203 | XSync(dpy, False); |
| 205 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | 204 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); |
| 206 | } | 205 | } |
