diff --git a/config.h b/config.h index 13d5abe..0ed934c 100644 --- a/config.h +++ b/config.h @@ -3,7 +3,6 @@ /* appearance */ static const unsigned int borderpx = 6; /* border pixel of windows */ static const unsigned int gappx = 6; -static const unsigned int cornerrad = 20; static const unsigned int snap = 32; /* snap pixel */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ diff --git a/dwm.c b/dwm.c index afb2239..b59db91 100644 --- a/dwm.c +++ b/dwm.c @@ -39,7 +39,6 @@ #ifdef XINERAMA #include #endif /* XINERAMA */ -#include #include #include "drw.h" @@ -242,7 +241,6 @@ static int xerrordummy(Display *dpy, XErrorEvent *ee); static int xerrorstart(Display *dpy, XErrorEvent *ee); static void xinitvisual(); static void zoom(const Arg *arg); -static void drawroundedcorners(Client *c); /* variables */ static const char broken[] = "broken"; @@ -1096,9 +1094,6 @@ manage(Window w, XWindowAttributes *wa) unfocus(selmon->sel, 0); c->mon->sel = c; arrange(c->mon); - - drawroundedcorners(c); - XMapWindow(dpy, c->win); focus(NULL); } @@ -1309,55 +1304,6 @@ resizeclient(Client *c, int x, int y, int w, int h) XSync(dpy, False); } -void drawroundedcorners(Client *c) { - // if set to zero in config.h, do not attempt to round - if(cornerrad < 0) return; - - // NOTE: this is extremely hacky and surely could be optimized. - // Any X wizards out there reading this, please pull request. - if (cornerrad > 0 && c && !c->isfullscreen) { - Window win; - win = c->win; - if(!win) return; - - XWindowAttributes win_attr; - if(!XGetWindowAttributes(dpy, win, &win_attr)) return; - - // set in config.h: - int dia = 2 * cornerrad; - int w = c->w; - int h = c->h; - if(w < dia || h < dia) return; - - Pixmap mask; - mask = XCreatePixmap(dpy, win, w, h, 1); - if(!mask) return; - - XGCValues xgcv; - GC shape_gc; - shape_gc = XCreateGC(dpy, mask, 0, &xgcv); - - if(!shape_gc) { - XFreePixmap(dpy, mask); - free(shape_gc); - return; - } - - XSetForeground(dpy, shape_gc, 0); - XFillRectangle(dpy, mask, shape_gc, 0, 0, w, h); - XSetForeground(dpy, shape_gc, 1); - XFillArc(dpy, mask, shape_gc, 0, 0, dia, dia, 0, 23040); - XFillArc(dpy, mask, shape_gc, w-dia-1, 0, dia, dia, 0, 23040); - XFillArc(dpy, mask, shape_gc, 0, h-dia-1, dia, dia, 0, 23040); - XFillArc(dpy, mask, shape_gc, w-dia-1, h-dia-1, dia, dia, 0, 23040); - XFillRectangle(dpy, mask, shape_gc, cornerrad, 0, w-dia, h); - XFillRectangle(dpy, mask, shape_gc, 0, cornerrad, w, h-dia); - XShapeCombineMask(dpy, win, ShapeBounding, 0, 0, mask, ShapeSet); - XFreePixmap(dpy, mask); - XFreeGC(dpy, shape_gc); - } -} - void resizemouse(const Arg *arg) { @@ -1402,9 +1348,6 @@ resizemouse(const Arg *arg) } if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) resize(c, c->x, c->y, nw, nh, 1); - - drawroundedcorners(c); - break; } } while (ev.type != ButtonRelease); @@ -1416,7 +1359,6 @@ resizemouse(const Arg *arg) selmon = m; focus(NULL); } - drawroundedcorners(c); } void diff --git a/dwm.o b/dwm.o index b1ef4b4..d1ab97f 100644 Binary files a/dwm.o and b/dwm.o differ