diff --git a/dwm.c b/dwm.c index 84e6188..53b393e 100644 --- a/dwm.c +++ b/dwm.c @@ -1732,10 +1732,6 @@ togglefloating(const Arg *arg) if (selmon->sel->isfloating) resize(selmon->sel, selmon->sel->x, selmon->sel->y, selmon->sel->w, selmon->sel->h, 0); - - selmon->sel->x = selmon->sel->mon->mx + (selmon->sel->mon->mw - WIDTH(selmon->sel)) / 2; - selmon->sel->y = selmon->sel->mon->my + (selmon->sel->mon->mh - HEIGHT(selmon->sel)) / 2; - arrange(selmon); } diff --git a/dwm.c.orig b/dwm.c.orig index 53b393e..84e6188 100644 --- a/dwm.c.orig +++ b/dwm.c.orig @@ -1732,6 +1732,10 @@ togglefloating(const Arg *arg) if (selmon->sel->isfloating) resize(selmon->sel, selmon->sel->x, selmon->sel->y, selmon->sel->w, selmon->sel->h, 0); + + selmon->sel->x = selmon->sel->mon->mx + (selmon->sel->mon->mw - WIDTH(selmon->sel)) / 2; + selmon->sel->y = selmon->sel->mon->my + (selmon->sel->mon->mh - HEIGHT(selmon->sel)) / 2; + arrange(selmon); } diff --git a/patches/dwm-togglefloatingcenter-20210806-138b405f.diff b/patches/dwm-togglefloatingcenter-20210806-138b405f.diff deleted file mode 100644 index ab38989..0000000 --- a/patches/dwm-togglefloatingcenter-20210806-138b405f.diff +++ /dev/null @@ -1,31 +0,0 @@ -From efa326b2c71f0df1d097fd52a17684f5ccc5df6c Mon Sep 17 00:00:00 2001 -From: Rizqi Nur Assyaufi -Date: Sat, 7 Aug 2021 00:24:01 +0800 -Subject: [PATCH] [dwm][patch][togglefloatingcenter] centered togglefloating - window - -Default behaviour when togglefloating() is floating from top-left corner. -This patch will allows you to toggle floating window client will be centered -position. ---- - dwm.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/dwm.c b/dwm.c -index 5e4d494..cbedb09 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -1719,6 +1719,10 @@ togglefloating(const Arg *arg) - if (selmon->sel->isfloating) - resize(selmon->sel, selmon->sel->x, selmon->sel->y, - selmon->sel->w, selmon->sel->h, 0); -+ -+ selmon->sel->x = selmon->sel->mon->mx + (selmon->sel->mon->mw - WIDTH(selmon->sel)) / 2; -+ selmon->sel->y = selmon->sel->mon->my + (selmon->sel->mon->mh - HEIGHT(selmon->sel)) / 2; -+ - arrange(selmon); - } - --- -2.31.1 -