[repo.or.cz] wmaker-crm.git branch master updated: wmaker-0.96.0-28-g72942267aae0

1 view
Skip to first unread message

crmafra

unread,
Jan 15, 2026, 10:58:34 AMJan 15
to wmake...@googlegroups.com
This is an automated email generated because a ref change occurred in the
git repository for project wmaker-crm.git.

The branch, master has been updated
via 72942267aae0082e7816df73636d0c23a167fc28 (commit)
from ac19c4bc0787e218f5af85925c3e5d0df0059c1e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 72942267aae0082e7816df73636d0c23a167fc28
Author: David Maciejak <david.m...@gmail.com>
Date: Wed, 14 Jan 2026 22:03:56 -0500
URL: <https://repo.or.cz/wmaker-crm.git/72942267aae0082e>

Prevent wrong UTF-8 window title truncation

The patch is fixing a UTF-8 truncation issue that could happen with the window title
when it was shrinked to be displayed in the window list (F11), leading to
an infinite loop.

Issue was reported at https://github.com/window-maker/wmaker/issues/61
---
src/misc.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/misc.c b/src/misc.c
index ffd97e6ed940..4c920520ad61 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -311,7 +311,8 @@ char *ShrinkString(WMFont *font, const char *string, int width)
p1 = 0;
p2 = p;
t = (p2 - p1) / 2;
- while (p2 > p1 && p1 != t) {
+ while (p2 > p1) {
+ int old_t = t;
/* ensure we cut at UTF-8 character boundary */
utf8_safe_pos = utf8_find_char_start(string, p - t);
t = p - utf8_safe_pos;
@@ -319,12 +320,20 @@ char *ShrinkString(WMFont *font, const char *string, int width)
w = WMWidthOfString(font, &string[utf8_safe_pos], t);
if (w > width) {
p2 = t;
- t = p1 + (p2 - p1) / 2;
} else if (w < width) {
p1 = t;
- t = p1 + (p2 - p1) / 2;
- } else
- p2 = p1 = t;
+ } else {
+ p1 = t;
+ break;
+ }
+
+ /* Calculate new t for next iteration */
+ t = p1 + (p2 - p1) / 2;
+
+ /* Prevent infinite loop if we're not making progress */
+ if (t == old_t || (p2 - p1) <= 1) {
+ break;
+ }
}

/* ensure final cut is at UTF-8 character boundary */

-----------------------------------------------------------------------

Summary of changes:
src/misc.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)


repo.or.cz automatic notification. Contact project admin crm...@gmail.com
if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive
no reply.
--
wmaker-crm.git ("The Window Maker window manager")
Reply all
Reply to author
Forward
0 new messages