mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-10-26 17:54:17 +00:00
76 lines
1.6 KiB
Diff
76 lines
1.6 KiB
Diff
From ae2c1d54a307bdecd876fc4764ff0f25c3f31a5b Mon Sep 17 00:00:00 2001
|
|
From: markus-langgeng <markus.langgeng4@gmail.com>
|
|
Date: Wed, 2 Apr 2025 15:27:04 +0700
|
|
Subject: [PATCH] Add movetocardinaldir-gaps
|
|
|
|
Respect gaps if gaps patch has been applied before
|
|
---
|
|
dwl.c | 28 ++++++++++++++--------------
|
|
1 file changed, 14 insertions(+), 14 deletions(-)
|
|
|
|
diff --git a/dwl.c b/dwl.c
|
|
index 919c773..dd5d4c8 100644
|
|
--- a/dwl.c
|
|
+++ b/dwl.c
|
|
@@ -1939,7 +1939,7 @@ movetocardinaldir(const Arg *arg)
|
|
{
|
|
Client *c = focustop(selmon);
|
|
Monitor *m = selmon;
|
|
- unsigned int mx, my, mw, mh, h, w;
|
|
+ unsigned int mx, my, mw, mh, h, w, e = m->gaps;
|
|
int nx, ny;
|
|
|
|
if(!(m && arg && arg->v && c && c->isfloating)) {
|
|
@@ -1955,35 +1955,35 @@ movetocardinaldir(const Arg *arg)
|
|
|
|
switch (arg->i) {
|
|
case DIR_NW:
|
|
- nx = mx;
|
|
- ny = my;
|
|
+ nx = mx + gappx*e;
|
|
+ ny = my + gappx*e;
|
|
break;
|
|
case DIR_N:
|
|
- nx = (mw - w) / 2;
|
|
- ny = my;
|
|
+ nx = (mw - w) / 2 + gappx*e;
|
|
+ ny = my + gappx*e;
|
|
break;
|
|
case DIR_NE:
|
|
- nx = mw - w;
|
|
- ny = my;
|
|
+ nx = mw - w - gappx*e;
|
|
+ ny = my + gappx*e;
|
|
break;
|
|
case DIR_E:
|
|
- nx = mx + mw - w;
|
|
+ nx = mx + mw - w - gappx*e;
|
|
ny = (mh - h) / 2 + my;
|
|
break;
|
|
case DIR_SE:
|
|
- nx = mw - w;
|
|
- ny = my + mh - h;
|
|
+ nx = mw - w - gappx*e;
|
|
+ ny = my + mh - h - gappx*e;
|
|
break;
|
|
case DIR_S:
|
|
nx = (mw - w) / 2 + mx;
|
|
- ny = my + mh - h;
|
|
+ ny = my + mh - h - gappx*e;
|
|
break;
|
|
case DIR_SW:
|
|
- nx = mx;
|
|
- ny = my + mh - h;
|
|
+ nx = mx + gappx*e;
|
|
+ ny = my + mh - h - gappx*e;
|
|
break;
|
|
case DIR_W:
|
|
- nx = mx;
|
|
+ nx = mx + gappx*e;
|
|
ny = (mh - h) / 2 + my;
|
|
break;
|
|
case DIR_C:
|
|
--
|
|
2.47.2
|
|
|