From bdfccdbfd78e2c891816fd9bfbf9c4ec22696f55 Mon Sep 17 00:00:00 2001 From: WanderingPenwing Date: Tue, 30 Jul 2024 18:03:56 +0200 Subject: [PATCH] revert corners --- config.h | 1 - dwm.c | 58 ------------------------------------------------------- dwm.o | Bin 55904 -> 54240 bytes 3 files changed, 59 deletions(-) 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 b1ef4b4edcafcb1c9d917e91d5f28381ff7b9455..d1ab97f48697fa03524d8c50ea50df2c4cf70861 100644 GIT binary patch delta 3436 zcmZ`*4^R~672jRJ9*RIa7Y_`HM|wJ7W5NjvcjA?^N3s{!#7s0&A#F_PcyUZ~=%JQc z&kjAp&K9HdM#4?R($u%Fa&x zX1@2n@Av+{_wB)@!)cd(o3^t^aQ^w=-2L;T3IDVHmHrhgMfq0uPM+hQ5#>8Q$T_k3 zT1~yEq|Yv*iyUx??u3LaFNJpmI$BXHDEBMXoFtF?<(53WBeNk>s?+gQpaEG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