mmistika 2025-08-13 18:22:12 +02:00
parent be0f7b5674
commit 214d0e400d
No known key found for this signature in database

View File

@ -1,4 +1,4 @@
From f109808140cd6323b3a100663a10e048ae32e3a0 Mon Sep 17 00:00:00 2001 From 5fab55803d009d400f6c3fcbe6a0fc807431bbe7 Mon Sep 17 00:00:00 2001
From: mmistika <mistikasoft@gmail.com> From: mmistika <mistikasoft@gmail.com>
Date: Thu, 17 Jul 2025 11:59:18 +0200 Date: Thu, 17 Jul 2025 11:59:18 +0200
Subject: [PATCH] Add configurable window resize Subject: [PATCH] Add configurable window resize
@ -6,8 +6,8 @@ Subject: [PATCH] Add configurable window resize
Signed-off-by: mmistika <mistikasoft@gmail.com> Signed-off-by: mmistika <mistikasoft@gmail.com>
--- ---
config.def.h | 12 ++++++++++++ config.def.h | 12 ++++++++++++
dwl.c | 45 +++++++++++++++++++++++++++++++++++++-------- dwl.c | 48 ++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 49 insertions(+), 8 deletions(-) 2 files changed, 52 insertions(+), 8 deletions(-)
diff --git a/config.def.h b/config.def.h diff --git a/config.def.h b/config.def.h
index 22d2171..e404549 100644 index 22d2171..e404549 100644
@ -33,7 +33,7 @@ index 22d2171..e404549 100644
static const Rule rules[] = { static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */ /* app_id title tags mask isfloating monitor */
diff --git a/dwl.c b/dwl.c diff --git a/dwl.c b/dwl.c
index c717c1d..aacd074 100644 index c717c1d..0d56b49 100644
--- a/dwl.c --- a/dwl.c
+++ b/dwl.c +++ b/dwl.c
@@ -407,6 +407,7 @@ static KeyboardGroup *kb_group; @@ -407,6 +407,7 @@ static KeyboardGroup *kb_group;
@ -44,7 +44,7 @@ index c717c1d..aacd074 100644
static struct wlr_output_layout *output_layout; static struct wlr_output_layout *output_layout;
static struct wlr_box sgeom; static struct wlr_box sgeom;
@@ -1873,8 +1874,24 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d @@ -1873,8 +1874,27 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
.width = grabc->geom.width, .height = grabc->geom.height}, 1); .width = grabc->geom.width, .height = grabc->geom.height}, 1);
return; return;
} else if (cursor_mode == CurResize) { } else if (cursor_mode == CurResize) {
@ -53,6 +53,9 @@ index c717c1d..aacd074 100644
+ int cdx = (int)round(cursor->x) - grabcx; + int cdx = (int)round(cursor->x) - grabcx;
+ int cdy = (int)round(cursor->y) - grabcy; + int cdy = (int)round(cursor->y) - grabcy;
+ +
+ cdx = !(rzcorner & 1) && grabc->geom.width - 2 * (int)grabc->bw - cdx < 1 ? 0 : cdx;
+ cdy = !(rzcorner & 2) && grabc->geom.height - 2 * (int)grabc->bw - cdy < 1 ? 0 : cdy;
+
+ const struct wlr_box box = { + const struct wlr_box box = {
+ .x = grabc->geom.x + (rzcorner & 1 ? 0 : cdx), + .x = grabc->geom.x + (rzcorner & 1 ? 0 : cdx),
+ .y = grabc->geom.y + (rzcorner & 2 ? 0 : cdy), + .y = grabc->geom.y + (rzcorner & 2 ? 0 : cdy),
@ -71,7 +74,7 @@ index c717c1d..aacd074 100644
return; return;
} }
@@ -1920,12 +1937,24 @@ moveresize(const Arg *arg) @@ -1920,12 +1940,24 @@ moveresize(const Arg *arg)
wlr_cursor_set_xcursor(cursor, cursor_mgr, "fleur"); wlr_cursor_set_xcursor(cursor, cursor_mgr, "fleur");
break; break;
case CurResize: case CurResize: