about summary refs log tree commit diff
path: root/dwm.c
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-06-19 22:33:19 +0200
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-06-19 22:33:19 +0200
commit2ffa4096bfd6c8600887199082e271aa2d581091 (patch)
treeac93cb10590fd7e20b63dc721446f84a0c000e10 /dwm.c
parentAdded the option for rounded corners [Patch] (diff)
downloaddwm-2ffa4096bfd6c8600887199082e271aa2d581091.tar.gz
dwm-2ffa4096bfd6c8600887199082e271aa2d581091.tar.bz2
dwm-2ffa4096bfd6c8600887199082e271aa2d581091.zip
Removed the option of rounded corners due to bad functionality
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c61
1 files changed, 1 insertions, 60 deletions
diff --git a/dwm.c b/dwm.c
index 8f3c986..b9d1830 100644
--- a/dwm.c
+++ b/dwm.c
@@ -38,7 +38,6 @@
 #include <X11/Xutil.h>
 #ifdef XINERAMA
 #include <X11/extensions/Xinerama.h>
-#include <X11/extensions/shape.h>
 #endif /* XINERAMA */
 #include <X11/Xft/Xft.h>
 
@@ -96,7 +95,7 @@ struct Client {
 	int basew, baseh, incw, inch, maxw, maxh, minw, minh;
 	int bw, oldbw;
 	unsigned int tags;
-	int isfixed, iscentered, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
+	int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
 	Client *next;
 	Client *snext;
 	Monitor *mon;
@@ -143,7 +142,6 @@ typedef struct {
 	const char *title;
 	unsigned int tags;
 	int isfloating;
-  int iscentered;
 	int monitor;
 } Rule;
 
@@ -195,7 +193,6 @@ static void quit(const Arg *arg);
 static Monitor *recttomon(int x, int y, int w, int h);
 static void resize(Client *c, int x, int y, int w, int h, int interact);
 static void resizeclient(Client *c, int x, int y, int w, int h);
-static void drawroundedcorners(Client *c);
 static void resizemouse(const Arg *arg);
 static void restack(Monitor *m);
 static void run(void);
@@ -313,7 +310,6 @@ applyrules(Client *c)
 		&& (!r->instance || strstr(instance, r->instance)))
 		{
 			c->isfloating = r->isfloating;
-      c->iscentered = r->iscentered;
 			c->tags |= r->tags;
 			for (m = mons; m && m->num != r->monitor; m = m->next);
 			if (m)
@@ -1068,12 +1064,6 @@ manage(Window w, XWindowAttributes *wa)
 		&& (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
 	c->bw = borderpx;
 
-  if(c->iscentered) {
-    c->x = (c->mon->mw - WIDTH(c)) / 2;
-    c->y = (c->mon->mh - HEIGHT(c)) / 2;
-    if(c->isfloating) drawroundedcorners(c);
-  }
-
 	wc.border_width = c->bw;
 	XConfigureWindow(dpy, w, CWBorderWidth, &wc);
 	XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
@@ -1300,58 +1290,11 @@ resizeclient(Client *c, int x, int y, int w, int h)
     c->h = wc.height += c->bw * 2;
   }
 
-  if(!c->isfloating && round_non_floating == 1) drawroundedcorners(c);
-
 	XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
 	configure(c);
 	XSync(dpy, False);
 }
 
-void drawroundedcorners(Client *c) {
-
-    if(corner_radius > 0 && c && !c->isfullscreen){
-        Window win;
-        win = c->win;
-        if(!win) return;
-
-        XWindowAttributes win_attr;
-        if(!XGetWindowAttributes(dpy, win, &win_attr)) return;
-
-        const int w = c->w;
-        const int h = c->h;
-
-        const int dia = 2 * corner_radius; // set in config.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, corner_radius, 0, w-dia, h);
-        XFillRectangle(dpy, mask, shape_gc, 0, corner_radius, w, h-dia);
-        XShapeCombineMask(dpy, win, ShapeBounding, 0, 0, mask, ShapeSet);
-        XFreePixmap(dpy, mask);
-        XFreeGC(dpy, shape_gc);
-    }
-}
-
 void
 resizemouse(const Arg *arg)
 {
@@ -1397,7 +1340,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);
@@ -1409,7 +1351,6 @@ resizemouse(const Arg *arg)
 		selmon = m;
 		focus(NULL);
 	}
-  drawroundedcorners(c);
 }
 
 void