commit 88341eaadb238ca66f9d9c64326723f2ede0ef71
Author: bastila <20937049+silentfault_AT_users.noreply.github.com>
Date: Thu Jul 23 03:00:28 2020 +0300
Fix centeredwindowname patch window name overflow
diff --git a/dwm.suckless.org/patches/centeredwindowname/dwm-centeredwindowname-20200723-f035e1e.diff b/dwm.suckless.org/patches/centeredwindowname/dwm-centeredwindowname-20200723-f035e1e.diff
new file mode 100644
index 00000000..67ae4d32
--- /dev/null
+++ b/dwm.suckless.org/patches/centeredwindowname/dwm-centeredwindowname-20200723-f035e1e.diff
_AT_@ -0,0 +1,30 @@
+From f035e1e5abb19df5dced9c592ca986deac460435 Mon Sep 17 00:00:00 2001
+From: bastila <20937049+silentfault_AT_users.noreply.github.com>
+Date: Thu, 23 Jul 2020 02:45:12 +0300
+Subject: [PATCH] Fix overflow when window name is bigger than window width
+
+---
+ dwm.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/dwm.c b/dwm.c
+index 9fd0286..42cb8dd 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -731,8 +731,12 @@ drawbar(Monitor *m)
+
+ if ((w = m->ww - tw - x) > bh) {
+ if (m->sel) {
++ /* fix overflow when window name is bigger than window width */
++ int mid = (m->ww - (int)TEXTW(m->sel->name)) / 2 - x;
++ /* make sure name will not overlap on tags even when it is very long */
++ mid = mid >= lrpad / 2 ? mid : lrpad / 2;
+ drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
+- drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
++ drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0);
+ if (m->sel->isfloating)
+ drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
+ } else {
+--
+2.27.0
+
diff --git a/dwm.suckless.org/patches/centeredwindowname/index.md b/dwm.suckless.org/patches/centeredwindowname/index.md
index fe172da4..16931a0a 100644
--- a/dwm.suckless.org/patches/centeredwindowname/index.md
+++ b/dwm.suckless.org/patches/centeredwindowname/index.md
_AT_@ -12,7 +12,9 @@ Download
--------
* [dwm-centeredwindowname-20180909-6.2.diff](dwm-centeredwindowname-20180909-6.2.diff)
* [dwm-centeredwindowname-20190907-cb3f58a.diff](dwm-centeredwindowname-20190907-cb3f58a.diff)
+* [dwm-centeredwindowname-20200723-f035e1e.diff](dwm-centeredwindowname-20200723-f035e1e.diff)
Authors
-------
* Sacules - <leociancalucas_AT_gmail.com>
+* [bastila](
https://github.com/silentfault): Fix window name overflow
Received on Thu Jul 23 2020 - 02:02:06 CEST