From 7f261214e1b7a78ed402964a4ccc1d5180feeab0 Mon Sep 17 00:00:00 2001 From: pi66 Date: Mon, 22 Dec 2025 10:17:12 +0100 Subject: [PATCH] add: prevent resizing fixed-size xdg-toplevel clients --- patches/lock-size/README.md | 14 ++++++++++++++ patches/lock-size/lock-size.patch | 29 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 patches/lock-size/README.md create mode 100644 patches/lock-size/lock-size.patch diff --git a/patches/lock-size/README.md b/patches/lock-size/README.md new file mode 100644 index 0000000..213d352 --- /dev/null +++ b/patches/lock-size/README.md @@ -0,0 +1,14 @@ +# Description +Prevent resizing of fixed-size xdg-toplevel windows. + +> NOTE: +The patch works on (main 2025-12-20) and v0.7 + +# Download +- [git branch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/lock-size/lock-size.patch) +- [main 2025-12-20](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/lock-size/lock-size.patch) +- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/lock-size/lock-size.patch) + +# Authors +- [pi66](https://pi66.xyz) + diff --git a/patches/lock-size/lock-size.patch b/patches/lock-size/lock-size.patch new file mode 100644 index 0000000..cbbaabd --- /dev/null +++ b/patches/lock-size/lock-size.patch @@ -0,0 +1,29 @@ +From a622b4740ff533f0fc46923990d421bf7c0892d8 Mon Sep 17 00:00:00 2001 +From: pi66 +Date: Sat, 20 Dec 2025 20:57:46 +0100 +Subject: [PATCH] fix: prevent resizing fixed-size xdg-toplevel clients + +--- + dwl.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/dwl.c b/dwl.c +index 12f441e..3a74a34 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -2210,6 +2210,12 @@ resize(Client *c, struct wlr_box geo, int interact) + if (!c->mon || !client_surface(c)->mapped) + return; + ++ if (c->surface.xdg->toplevel->current.min_width==c->surface.xdg->toplevel->current.max_width) ++ geo.width = c->geom.width; ++ ++ if (c->surface.xdg->toplevel->current.min_height==c->surface.xdg->toplevel->current.max_height) ++ geo.height = c->geom.height; ++ + bbox = interact ? &sgeom : &c->mon->w; + + client_set_bounds(c, geo.width, geo.height); +-- +2.51.2 +