diff --git a/README.md b/README.md index a9291c8..a8d3fde 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ If you are experiencing issues then you may want to check out the [Known Issues] ### Changelog: +2021-09-08 - Added the alwayscenter patch + 2021-07-27 - Added the winicon patch 2021-05-30 - Added togglelayout and toggletag patches @@ -217,6 +219,9 @@ If you are experiencing issues then you may want to check out the [Known Issues] - [alttagsdecoration](https://dwm.suckless.org/patches/alttagsdecoration/) - provides the ability to use alternative text for tags which contain at least one window + - [alwayscenter](https://dwm.suckless.org/patches/alwayscenter/) + - makes all floating windows centered, like the center patch, but without a rule + - [~alwaysfullscreen~](https://dwm.suckless.org/patches/alwaysfullscreen/) - ~prevents the focus to drift from the active fullscreen client when using focusstack\(\)~ diff --git a/dwm.c b/dwm.c index 43b37c8..f5f9115 100644 --- a/dwm.c +++ b/dwm.c @@ -2381,6 +2381,9 @@ manage(Window w, XWindowAttributes *wa) c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2; c->y = c->mon->wy + (c->mon->wh - HEIGHT(c)) / 2; } + #elif ALWAYSCENTER_PATCH + c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2; + c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2; #endif // CENTER_PATCH #if SAVEFLOATS_PATCH || EXRESIZE_PATCH c->sfx = -9999; diff --git a/patches.def.h b/patches.def.h index a2176bf..809d714 100644 --- a/patches.def.h +++ b/patches.def.h @@ -394,6 +394,13 @@ * Other patches */ +/* All floating windows are centered, like the center patch, but without a rule. + * The center patch takes precedence over this patch. + * This patch interferes with the center transient windows patches. + * https://dwm.suckless.org/patches/alwayscenter/ + */ +#define ALWAYSCENTER_PATCH 0 + /* This patch allows windows to be resized with its aspect ratio remaining constant. * https://dwm.suckless.org/patches/aspectresize/ */ @@ -438,7 +445,7 @@ #define AUTORESIZE_PATCH 0 /* This patch adds an iscentered rule to automatically center clients on the current monitor. - * This patch takes precedence over centeredwindowname and fancybar patches. + * This patch takes precedence over centeredwindowname, alwayscenter and fancybar patches. * https://dwm.suckless.org/patches/center/ */ #define CENTER_PATCH 0