diff --git a/README.md b/README.md index a2373fd..9b22a7e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -This dwm 6.3 (5b2e5e7, 2022-07-29) 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. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0). +This dwm 6.3 (5e76e7e, 2022-08-06) 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. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0). 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 diff --git a/dwm.c b/dwm.c index 20e8496..9a73159 100644 --- a/dwm.c +++ b/dwm.c @@ -2222,13 +2222,11 @@ gettextprop(Window w, Atom atom, char *text, unsigned int size) text[0] = '\0'; if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems) return 0; - if (name.encoding == XA_STRING) + if (name.encoding == XA_STRING) { strncpy(text, (char *)name.value, size - 1); - else { - if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { - strncpy(text, *list, size - 1); - XFreeStringList(list); - } + } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { + strncpy(text, *list, size - 1); + XFreeStringList(list); } text[size - 1] = '\0'; XFree(name.value); @@ -2625,9 +2623,7 @@ maprequest(XEvent *e) } #endif // BAR_SYSTRAY_PATCH - if (!XGetWindowAttributes(dpy, ev->window, &wa)) - return; - if (wa.override_redirect) + if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect) return; #if BAR_ANYBAR_PATCH if (wmclasscontains(ev->window, altbarclass, "")) @@ -4961,12 +4957,7 @@ zoom(const Arg *arg) c->mon->pertag->prevclient[c->mon->pertag->curtag] = nexttiled(c->mon->clients); #endif // SWAPFOCUS_PATCH - if (!c->mon->lt[c->mon->sellt]->arrange - || (c && c->isfloating) - #if ZOOMSWAP_PATCH - || !c - #endif // ZOOMSWAP_PATCH - ) + if (!c->mon->lt[c->mon->sellt]->arrange || !c || c->isfloating) return; #if ZOOMSWAP_PATCH @@ -5019,14 +5010,13 @@ zoom(const Arg *arg) } focus(c); arrange(c->mon); + #elif SWAPFOCUS_PATCH && PERTAG_PATCH + if (c == nexttiled(c->mon->clients) && !(c = c->mon->pertag->prevclient[c->mon->pertag->curtag] = nexttiled(c->next))) + return; + pop(c); #else - if (c == nexttiled(c->mon->clients)) - #if SWAPFOCUS_PATCH && PERTAG_PATCH - if (!c || !(c = c->mon->pertag->prevclient[c->mon->pertag->curtag] = nexttiled(c->next))) - #else - if (!c || !(c = nexttiled(c->next))) - #endif // SWAPFOCUS_PATCH - return; + if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next))) + return; pop(c); #endif // ZOOMSWAP_PATCH }