summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2021-09-08 09:42:47 +0200
committerbakkeby <[email protected]>2021-09-08 09:42:47 +0200
commit22bbf1cb13439681a025f7a8aa960bb18afbf3e4 (patch)
tree53e9a6000ce0600031ea4023f266f7cdc5fcce67
parent036421845ff585b87304e70e1168f24aab80ccdd (diff)
downloaddwm-flexipatch-22bbf1cb13439681a025f7a8aa960bb18afbf3e4.tar.gz
dwm-flexipatch-22bbf1cb13439681a025f7a8aa960bb18afbf3e4.zip
Adding alwayscenter patch ref. #182
-rw-r--r--README.md5
-rw-r--r--dwm.c3
-rw-r--r--patches.def.h9
3 files changed, 16 insertions, 1 deletions
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