X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=draw.c;h=869c2f21797b8627102c56e64f227e2924836968;hb=fde45ebed844c227a17c21d161f60aa55c8b3c41;hp=812f39863e60083bd2526ab673d9810602eb44ab;hpb=30561a0161629b15abe1beeb97eec3fc0768efaf;p=dwm.git diff --git a/draw.c b/draw.c index 812f398..869c2f2 100644 --- a/draw.c +++ b/draw.c @@ -9,6 +9,26 @@ /* static */ +static void +drawborder(void) +{ + XPoint points[5]; + + XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); + XSetForeground(dpy, dc.gc, dc.border); + points[0].x = dc.x; + points[0].y = dc.y; + points[1].x = dc.w - 1; + points[1].y = 0; + points[2].x = 0; + points[2].y = dc.h - 1; + points[3].x = -(dc.w - 1); + points[3].y = 0; + points[4].x = 0; + points[4].y = -(dc.h - 1); + XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious); +} + static unsigned int textnw(const char *text, unsigned int len) { @@ -32,6 +52,7 @@ drawtext(const char *text, Bool invert) XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg); XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); + drawborder(); if(!text) return; @@ -117,7 +138,7 @@ drawtitle(Client *c) int i; Bool istile = arrange == dotile; - if(c == sel) { + if(c == sel && issel) { drawstatus(); XUnmapWindow(dpy, c->title); XSetWindowBorder(dpy, c->win, dc.fg);