remove rounded corners

honestly it's not a very useful feature and the corners don't look that
nice.

if you want good rounded corners that also works on the bar i might add,
use picom and set up some rules.

i plan on making a list of classes speedwm uses so that you can apply it
to only speedwm if you so wish.
This commit is contained in:
speedie 2022-12-30 14:43:57 +01:00
parent 93505adb16
commit 4d4a2b69c2
6 changed files with 0 additions and 106 deletions

1
TODO
View file

@ -3,5 +3,4 @@
- Figure out how to get toggletopbar func working
- Logo to replace speedwm.png
- Click to minimize
- Remove rounded corners
- Perhaps introduce padding around text/bar

View file

@ -29,8 +29,6 @@ speedwm.bar.hide.clientindicator: 0 ! Hide the client indicator on the tags
speedwm.bar.titleposition: 1 ! Position of the title (0: Left, 1: Center)
!! Border options
speedwm.border.roundedcorners: 0 ! Enable rounded corners around the border of windows (0/1)
speedwm.border.cornerradius: 2 ! Corner radius when rounded corners are enabled (<num>)
speedwm.border.size: 1 ! Size of the border around windows in pixels (<num>)
!! Client options

View file

@ -35,10 +35,6 @@ static int fadeinactive = 1; /* Fade inactive windows */
static double activeopacity = 1.0f; /* Window opacity when it's focused (0 <= opacity <= 1) */
static double inactiveopacity = 0.875f; /* Window opacity when it's inactive (0 <= opacity <= 1) */
/* Rounded corners */
static int roundedcorners = 0; /* Enable (1) rounded corners or disable (0) rounded corners. */
static int cornerradius = 2; /* Radius of rounded corners, 10 is the default. */
/* Tag preview options */
static int tagpreview = 1; /* Enable tag previews */
static int tagpreviewpaddingv = 0; /* Vertical tag padding */

View file

@ -23,9 +23,6 @@
#if USEXRESOURCES
#include <X11/Xresource.h>
#endif
#if USEROUNDCORNERS
#include <X11/extensions/shape.h>
#endif
#ifdef XINERAMA
#include <X11/extensions/Xinerama.h>
#endif /* XINERAMA */
@ -502,9 +499,6 @@ static void dragmfact(const Arg *arg);
static void drawbaritems(Monitor *m);
static void drawbarwin(Bar *bar);
static void drawbar(void);
#if USEROUNDCORNERS
static void drawroundedcorners(Client *c);
#endif
static void enternotify(XEvent *e);
static void expose(XEvent *e);
static void focus(Client *c);
@ -1181,14 +1175,6 @@ arrangemon(Monitor *m)
if (m->lt[m->sellt]->arrange) {
m->lt[m->sellt]->arrange(m);
}
#if USEROUNDCORNERS
if (roundedcorners) {
Client *c;
for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
drawroundedcorners(c);
}
#endif
}
void
@ -1212,13 +1198,6 @@ moveresizeaspect(const Arg *arg) {
XRaiseWindow(dpy, c->win);
resize(c, c->x, c->y, nw, nh, True);
#if USEROUNDCORNERS
if (roundedcorners) {
XRectangle rect = { .x = 0, .y = 0, .width = c->w, .height = c->h };
XShapeCombineRectangles(dpy, c->win, ShapeBounding, 0, 0, &rect, 1, ShapeSet, 1);
}
#endif
}
void
@ -1656,54 +1635,6 @@ configurenotify(XEvent *e)
}
}
/* draw rounded corners for current client */
#if USEROUNDCORNERS
void
drawroundedcorners(Client *c)
{
Window w = c->win;
XWindowAttributes wa;
XGetWindowAttributes(dpy, w, &wa);
if(!XGetWindowAttributes(dpy, w, &wa))
return;
int width = bordersize * 2 + wa.width;
int height = bordersize * 2 + wa.height;
int rad = cornerradius;
int dia = 2 * rad;
if(width < dia || height < dia)
return;
Pixmap mask = XCreatePixmap(dpy, w, width, height, 1);
if(!mask)
return;
XGCValues xgcv;
GC shape_gc = XCreateGC(dpy, mask, 0, &xgcv);
if(!shape_gc) {
XFreePixmap(dpy, mask);
return;
}
XSetForeground(dpy, shape_gc, 0);
XFillRectangle(dpy, mask, shape_gc, 0, 0, width, height);
XSetForeground(dpy, shape_gc, 1);
XFillArc(dpy, mask, shape_gc, 0, 0, dia, dia, 0, 23040);
XFillArc(dpy, mask, shape_gc, width-dia-1, 0, dia, dia, 0, 23040);
XFillArc(dpy, mask, shape_gc, 0, height-dia-1, dia, dia, 0, 23040);
XFillArc(dpy, mask, shape_gc, width-dia-1, height-dia-1, dia, dia, 0, 23040);
XFillRectangle(dpy, mask, shape_gc, rad, 0, width-dia, height);
XFillRectangle(dpy, mask, shape_gc, 0, rad, width, height-dia);
XShapeCombineMask(dpy, w, ShapeBounding, 0-wa.border_width, 0-wa.border_width, mask, ShapeSet);
XFreePixmap(dpy, mask);
XFreeGC(dpy, shape_gc);
}
#endif
void
configurerequest(XEvent *e)
{
@ -3655,13 +3586,6 @@ moveresize(const Arg *arg) {
if ((msx + nmx) > c->x && (msy + nmy) > c->y)
XWarpPointer(dpy, None, None, 0, 0, 0, 0, nmx, nmy);
}
#if USEROUNDCORNERS
if (roundedcorners) {
XRectangle rect = { .x = 0, .y = 0, .width = c->w, .height = c->h };
XShapeCombineRectangles(dpy, c->win, ShapeBounding, 0, 0, &rect, 1, ShapeSet, 1);
}
#endif
}
#if USESWITCHER
@ -3951,12 +3875,6 @@ moveresizeedge(const Arg *arg) {
XWarpPointer(dpy, None, None, 0, 0, 0, 0, nmx, nmy);
}
#if USEROUNDCORNERS
if (roundedcorners) {
XRectangle rect = { .x = 0, .y = 0, .width = c->w, .height = c->h };
XShapeCombineRectangles(dpy, c->win, ShapeBounding, 0, 0, &rect, 1, ShapeSet, 1);
}
#endif
}
Client *
@ -5016,12 +4934,6 @@ setfullscreen(Client *c, int fullscreen)
c->bw = 0;
c->isfloating = 1;
resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
#if USEROUNDCORNERS
if (roundedcorners) {
XRectangle rect = { .x = 0, .y = 0, .width = c->w, .height = c->h };
XShapeCombineRectangles(dpy, c->win, ShapeBounding, 0, 0, &rect, 1, ShapeSet, 1);
}
#endif
XRaiseWindow(dpy, c->win);
} else if (!fullscreen && c->isfullscreen){
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
@ -5034,12 +4946,6 @@ setfullscreen(Client *c, int fullscreen)
c->w = c->oldw;
c->h = c->oldh;
resizeclient(c, c->x, c->y, c->w, c->h);
#if USEROUNDCORNERS
if (roundedcorners) {
XRectangle rect = { .x = 0, .y = 0, .width = c->w, .height = c->h };
XShapeCombineRectangles(dpy, c->win, ShapeBounding, 0, 0, &rect, 1, ShapeSet, 1);
}
#endif
arrange(c->mon);
}
}

View file

@ -20,7 +20,6 @@ Not compatible with BSDs so for those, set this to 0. */
/* Miscellanious */
#define USESWITCHER 1 /* Whether or not to include the switcher */
#define USESYSTRAY 1 /* Whether or not to include the systray */
#define USEROUNDCORNERS 1 /* Whether or not to include rounded corners */
#define USEMEDIA 1 /* Whether or not to include media keys */
#define USEMOUSE 1 /* Whether or not to include mouse binds */
#define USEXRESOURCES 1 /* Whether or not to include .Xresources support. */

View file

@ -197,10 +197,6 @@ ResourcePref resources[] = {
{ "client.fade.inactive", INTEGER, &fadeinactive },
{ "client.fade.windows", INTEGER, &fadewindows },
#endif
#if USEROUNDCORNERS
{ "border.roundedcorners", INTEGER, &roundedcorners },
{ "border.cornerradius", INTEGER, &cornerradius },
#endif
/* Traditional color system support (for example useful for Pywal) */
{ "color0", STRING, &col_background },