This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.
The branch, next has been updated
via 4f050ebab997782461d7c6b65dea7b535916329f (commit)
from 88352b72743a997122a83472f510e6dac14974ef (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 -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/4f050ebab997782461d7c6b65dea7b535916329f
commit 4f050ebab997782461d7c6b65dea7b535916329f
Author: Christophe CURIS <[email protected]>
Date: Sat Nov 29 16:06:42 2014 +0100
WINGs: fix infinite loop when using Pango on string that have to be split
As reported by Charles Philip Chan, WPrefs would get into infinite loop
when the support for Pango is enabled.
The problem is due to long strings that are broken into multiple lines by
WINGs. This is done in an iterative process in the internal function
'fitText'.
In order to avoid the cost of duplicating many times the sub-strings, the
functions involved do not place a NUL at the string-splitting position, but
they rely instead on giving the length of the string as a parameter.
The code that checks the Pango text (to avoid re-submitting the string when
not needed) did not use that length, so it would always keep the original
string that is too long, so the fitText function would always receive the
same result and loop forever trying to find where to split the string.
This patch adds the check on the length, so Pango is given the appropriate
string for its pixel size calculation.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/WINGs/wfont.c b/WINGs/wfont.c
index a5cff072..b3d399cf 100644
--- a/WINGs/wfont.c
+++ b/WINGs/wfont.c
@@ -295,7 +295,7 @@ int WMWidthOfString(WMFont * font, const char *text, int
length)
wassertrv(font != NULL && text != NULL, 0);
#ifdef USE_PANGO
previous_text = pango_layout_get_text(font->layout);
- if ((previous_text == NULL) || (strcmp(text, previous_text) != 0))
+ if ((previous_text == NULL) || (strncmp(text, previous_text, length) !=
0) || previous_text[length] != '0')
pango_layout_set_text(font->layout, text, length);
pango_layout_get_pixel_size(font->layout, &width, NULL);
-----------------------------------------------------------------------
Summary of changes:
WINGs/wfont.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
--
wmaker-crm.git ("The Window Maker window manager")
--
To unsubscribe, send mail to [email protected].