]> git.armaanb.net Git - dwm.git/commitdiff
removed drawclient and drawall (they performed useless operations/consumed useless...
authorAnselm R. Garbe <arg@suckless.org>
Mon, 15 Jan 2007 11:04:25 +0000 (12:04 +0100)
committerAnselm R. Garbe <arg@suckless.org>
Mon, 15 Jan 2007 11:04:25 +0000 (12:04 +0100)
client.c
draw.c
dwm.h
event.c
view.c

index af13797094c6f2024580af7cafbaaa8b8899985f..b122427cace994f9768fa3ea76d544bea44470af 100644 (file)
--- a/client.c
+++ b/client.c
@@ -90,7 +90,7 @@ focus(Client *c) {
                sel = c;
                if(old) {
                        grabbuttons(old, False);
-                       drawclient(old);
+                       XSetWindowBorder(dpy, old->win, dc.norm[ColBorder]);
                }
        }
        if(c) {
@@ -98,11 +98,12 @@ focus(Client *c) {
                c->snext = stack;
                stack = c;
                grabbuttons(c, True);
-               drawclient(c);
+               XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
                XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
        }
        else
                XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+       drawstatus();
 }
 
 Client *
diff --git a/draw.c b/draw.c
index 19604f35e39dc4c8b5c56925470668d5118ef6d5..fe2951ce5e9c66f5e6869531858b876c02cf849f 100644 (file)
--- a/draw.c
+++ b/draw.c
@@ -97,15 +97,6 @@ drawtext(const char *text, unsigned long col[ColLast], Bool filledsquare, Bool e
 
 /* extern */
 
-void
-drawall(void) {
-       Client *c;
-
-       for(c = clients; c; c = getnext(c->next))
-               drawclient(c);
-       drawstatus();
-}
-
 void
 drawstatus(void) {
        int i, x;
@@ -137,17 +128,6 @@ drawstatus(void) {
        XSync(dpy, False);
 }
 
-void
-drawclient(Client *c) {
-       if(c == sel && issel) {
-               drawstatus();
-               XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
-               return;
-       }
-       XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
-       XSync(dpy, False);
-}
-
 unsigned long
 getcolor(const char *colstr) {
        Colormap cmap = DefaultColormap(dpy, screen);
diff --git a/dwm.h b/dwm.h
index 37893739dc270d1b0649af2ee259e50d85b6d8ae..03f8c1f56ff64cc71e8d333dd4e3a4015eceaddf 100644 (file)
--- a/dwm.h
+++ b/dwm.h
@@ -117,9 +117,7 @@ extern void updatetitle(Client *c);         /* update the name of c */
 extern void unmanage(Client *c);               /* destroy c */
 
 /* draw.c */
-extern void drawall(void);                     /* draw all visible client titles and the bar */
 extern void drawstatus(void);                  /* draw the bar */
-extern void drawclient(Client *c);             /* draw title and set border of c */
 extern unsigned long getcolor(const char *colstr);     /* return color of colstr */
 extern void setfont(const char *fontstr);      /* set the font for DC */
 extern unsigned int textw(const char *text);   /* return the width of text in px*/
diff --git a/event.c b/event.c
index a9d2fbbf78d260401fc5798d75ae275637b78cf9..a8095116e638f3bf6b6a234df411ebde49836dc1 100644 (file)
--- a/event.c
+++ b/event.c
@@ -235,7 +235,6 @@ enternotify(XEvent *e) {
        else if(ev->window == root) {
                issel = True;
                XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
-               drawall();
        }
 }
 
@@ -272,10 +271,8 @@ static void
 leavenotify(XEvent *e) {
        XCrossingEvent *ev = &e->xcrossing;
 
-       if((ev->window == root) && !ev->same_screen) {
+       if((ev->window == root) && !ev->same_screen)
                issel = False;
-               drawall();
-       }
 }
 
 static void
@@ -329,7 +326,8 @@ propertynotify(XEvent *e) {
                }
                if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
                        updatetitle(c);
-                       drawclient(c);
+                       if(c == sel)
+                               drawstatus();
                }
        }
 }
diff --git a/view.c b/view.c
index 935525fb7f927ec14b1c9178d24e63bed1ab1ce1..bc1f4e25cb3da31289fc04dfe220823125a37bf0 100644 (file)
--- a/view.c
+++ b/view.c
@@ -200,7 +200,6 @@ restack(void) {
                        XLowerWindow(dpy, c->win);
                }
        }
-       drawall();
        XSync(dpy, False);
        while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
 }