dwm-sendmoncenter-20210805-138b405f.diff - sites - public wiki contents of suckless.org
(HTM) git clone git://git.suckless.org/sites
(DIR) Log
(DIR) Files
(DIR) Refs
---
dwm-sendmoncenter-20210805-138b405f.diff (804B)
---
1 From 449324adbe53240a734cb5f8f72763bb3419829a Mon Sep 17 00:00:00 2001
2 From: Rizqi Nur Assyaufi <bandithijo@gmail.com>
3 Date: Sat, 5 Aug 2021 00:04:32 +0800
4 Subject: [PATCH] [sendmoncenter] Send floating window to another monitor will
5 centered
6
7 This patch will allows you to send floating window client to another monitor
8 will be centered position.
9 ---
10 dwm.c | 2 ++
11 1 file changed, 2 insertions(+)
12
13 diff --git a/dwm.c b/dwm.c
14 index 5e4d494..c20023e 100644
15 --- a/dwm.c
16 +++ b/dwm.c
17 @@ -1418,6 +1418,8 @@ sendmon(Client *c, Monitor *m)
18 detachstack(c);
19 c->mon = m;
20 c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
21 + c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
22 + c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
23 attach(c);
24 attachstack(c);
25 focus(NULL);
26 --
27 2.31.1
28