[wiki] [sites] [dwm][patch][sendmoncenter] Send floating window to another monitor will centered || Rizqi Nur Assyaufi

From: <git_AT_suckless.org>
Date: Thu, 05 Aug 2021 11:18:37 +0200

commit 138e9dfca1c9eba5554b4072066eda7013ec8144
Author: Rizqi Nur Assyaufi <bandithijo_AT_gmail.com>
Date: Thu Aug 5 17:16:07 2021 +0800

    [dwm][patch][sendmoncenter] Send floating window to another monitor will centered
    
    This patch will allows you to send floating window client to another monitor
    will be centered position. Especially if you have different monitor resolution
    between primary and secondary monitor.

diff --git a/dwm.suckless.org/patches/sendmoncenter/dwm-sendmoncenter-20210805-138b405f.diff b/dwm.suckless.org/patches/sendmoncenter/dwm-sendmoncenter-20210805-138b405f.diff
new file mode 100644
index 00000000..1cf4dd49
--- /dev/null
+++ b/dwm.suckless.org/patches/sendmoncenter/dwm-sendmoncenter-20210805-138b405f.diff
_AT_@ -0,0 +1,29 @@
+Date: Thu, 5 Aug 2021 16:09:20 +0800
+From: Rizqi Nur Assyaufi <bandithijo_AT_gmail.com>
+To: wiki_AT_suckless.org
+Cc: Rizqi Nur Assyaufi <bandithijo_AT_gmail.com>
+Subject: [PATCH] [sendmoncenter] Send floating window to another monitor
+ will centered
+
+This patch will allows you to send floating window client to another monitor
+will be centered position.
+
+---
+ dwm.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/dwm.c b/dwm.c
+index 5e4d494..c20023e 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -1418,6 +1418,8 @@ sendmon(Client *c, Monitor *m)
+ detachstack(c);
+ c->mon = m;
+ c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
++ c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
++ c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
+ attach(c);
+ attachstack(c);
+ focus(NULL);
+--
+2.31.1
diff --git a/dwm.suckless.org/patches/sendmoncenter/index.md b/dwm.suckless.org/patches/sendmoncenter/index.md
new file mode 100644
index 00000000..61d7c1d1
--- /dev/null
+++ b/dwm.suckless.org/patches/sendmoncenter/index.md
_AT_@ -0,0 +1,18 @@
+sendmoncenter
+============
+
+Description
+-----------
+This patch will allows you to send floating window client to another monitor
+will be centered position. Especially if you have different monitor resolution
+between primary and secondary monitor.
+
+The original code is from [alwayscenter](../alwayscenter/) patch.
+
+Download
+--------
+* [dwm-sendmoncenter-20210805-138b405f.diff](dwm-sendmoncenter-20210805-138b405f.diff)
+
+Author
+------
+* Rizqi Nur Assyaufi - <bandithijo_AT_gmail.com>
Received on Thu Aug 05 2021 - 11:18:37 CEST

This archive was generated by hypermail 2.3.0 : Thu Aug 05 2021 - 11:24:40 CEST