Compare commits

5 Commits

4 changed files with 15 additions and 2 deletions

View File

@ -1,4 +1,4 @@
This dwm 6.2 (aaad5f, 2020-07-08) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more.
This dwm 6.2 (bb2e72, 2020-07-08) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more.
For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/dwm-flexipatch/blob/master/patches.def.h):
```c

6
dwm.c
View File

@ -3698,9 +3698,15 @@ togglebar(const Arg *arg)
if (!selmon->showbar)
wc.y = -bh;
else if (selmon->showbar) {
#if BARPADDING_PATCH
wc.y = vp;
if (!selmon->topbar)
wc.y = selmon->mh - bh + vp;
#else
wc.y = 0;
if (!selmon->topbar)
wc.y = selmon->mh - bh;
#endif // BARPADDING_PATCH
}
XConfigureWindow(dpy, systray->win, CWY, &wc);
}

View File

@ -4,6 +4,8 @@ movestack(const Arg *arg)
Client *c = NULL, *p = NULL, *pc = NULL, *i;
if (arg->i > 0) {
if (!selmon->sel)
return;
/* find the client after selmon->sel */
for (c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
if (!c)

View File

@ -77,14 +77,15 @@ updatesystray(void)
wa.override_redirect = True;
wa.event_mask = ButtonPressMask|ExposureMask;
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
wa.border_pixel = 0;
#if ALPHA_PATCH
wa.background_pixel = 0;
wa.colormap = cmap;
systray->win = XCreateWindow(dpy, root, x - xpad, m->by + ypad, w, bh, 0, depth,
InputOutput, visual,
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
#else
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
systray->win = XCreateSimpleWindow(dpy, root, x - xpad, m->by + ypad, w, bh, 0, 0, scheme[SchemeNorm][ColBg].pixel);
XChangeWindowAttributes(dpy, systray->win, CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWEventMask, &wa);
#endif // ALPHA_PATCH
@ -114,7 +115,11 @@ updatesystray(void)
drw_setscheme(drw, scheme[SchemeNorm]);
for (w = 0, i = systray->icons; i; i = i->next) {
/* make sure the background color stays the same */
#if ALPHA_PATCH
wa.background_pixel = 0;
#else
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
#endif // ALPHA_PATCH
XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa);
XMapRaised(dpy, i->win);
w += systrayspacing;