diff options
author | Leonard Kugis <leonard@kug.is> | 2025-05-23 11:41:09 +0000 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2025-05-23 11:41:09 +0000 |
commit | c70505d7c7b7b48600f273357694b56ccf5d2a15 (patch) | |
tree | 21c27ac6ffced8d6d904e35bdb39baa5d685d829 /dwl-patches/patches/alwayscenter | |
download | dotfiles-master.tar.gz dotfiles-master.tar.bz2 dotfiles-master.zip |
Diffstat (limited to 'dwl-patches/patches/alwayscenter')
-rw-r--r-- | dwl-patches/patches/alwayscenter/README.md | 9 | ||||
-rw-r--r-- | dwl-patches/patches/alwayscenter/alwayscenter.patch | 38 |
2 files changed, 47 insertions, 0 deletions
diff --git a/dwl-patches/patches/alwayscenter/README.md b/dwl-patches/patches/alwayscenter/README.md new file mode 100644 index 0000000..63d6f86 --- /dev/null +++ b/dwl-patches/patches/alwayscenter/README.md @@ -0,0 +1,9 @@ +### Description
+Automatically center floating windows.
+
+### Download
+- [git branch](https://codeberg.org/guidocella/dwl/src/branch/alwayscenter)
+- [2024-06-05](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/alwayscenter/alwayscenter.patch)
+
+### Authors
+- [Guido Cella](https://codeberg.org/guidocella)
diff --git a/dwl-patches/patches/alwayscenter/alwayscenter.patch b/dwl-patches/patches/alwayscenter/alwayscenter.patch new file mode 100644 index 0000000..a046ef7 --- /dev/null +++ b/dwl-patches/patches/alwayscenter/alwayscenter.patch @@ -0,0 +1,38 @@ +From 6616470ef135019ef4c767003a66df76df45f53e Mon Sep 17 00:00:00 2001 +From: Guido Cella <guido@guidocella.xyz> +Date: Wed, 5 Jun 2024 12:05:16 +0200 +Subject: [PATCH] center floating windows + +--- + dwl.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dwl.c b/dwl.c +index 6f041a0..79ace52 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -472,6 +472,10 @@ applyrules(Client *c) + } + } + } ++ if (mon) { ++ c->geom.x = (mon->w.width - c->geom.width) / 2 + mon->m.x; ++ c->geom.y = (mon->w.height - c->geom.height) / 2 + mon->m.y; ++ } + setmon(c, mon, newtags); + } + +@@ -1677,6 +1681,10 @@ mapnotify(struct wl_listener *listener, void *data) + * try to apply rules for them */ + if ((p = client_get_parent(c))) { + c->isfloating = 1; ++ if (p->mon) { ++ c->geom.x = (p->mon->w.width - c->geom.width) / 2 + p->mon->m.x; ++ c->geom.y = (p->mon->w.height - c->geom.height) / 2 + p->mon->m.y; ++ } + setmon(c, p->mon, p->tags); + } else { + applyrules(c); +-- +2.45.1 + |