[hackers] [tabbed][PATCH] Use utf8 for window properties

From: Nikita Zlobin <nick87720z_AT_gmail.com>
Date: Thu, 11 Jun 2020 13:55:32 +0500

At least some desktop tools (non-mainstream) are in trouble with tabbed window name.
At the moment of try I have only tint2 and rofi. First just showes intitled, but
second - "Invalid encoding". Though xfwm4 has no problem with compound text names.
As for other properties - utf8 still looks good, since it's ascii-compatible.
---
 tabbed.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tabbed.c b/tabbed.c
index eafe28a..283911c 100644
--- a/tabbed.c
+++ b/tabbed.c
_AT_@ -616,7 +616,7 @@ gettextprop(Window w, Atom atom, char *text, unsigned int size)
 
 	if (name.encoding == XA_STRING) {
 		strncpy(text, (char *)name.value, size - 1);
-	} else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success
+	} else if (Xutf8TextPropertyToTextList(dpy, &name, &list, &n) >= Success
 	           && n > 0 && *list) {
 		strncpy(text, *list, size - 1);
 		XFreeStringList(list);
_AT_@ -1257,8 +1257,8 @@ xsettitle(Window w, const char *str)
 {
 	XTextProperty xtp;
 
-	if (XmbTextListToTextProperty(dpy, (char **)&str, 1,
-	    XCompoundTextStyle, &xtp) == Success) {
+	if (Xutf8TextListToTextProperty(dpy, (char **)&str, 1,
+	    XUTF8StringStyle, &xtp) == Success) {
 		XSetTextProperty(dpy, w, &xtp, wmatom[WMName]);
 		XSetTextProperty(dpy, w, &xtp, XA_WM_NAME);
 		XFree(xtp.value);
-- 
2.26.2
Received on Thu Jun 11 2020 - 10:55:32 CEST

This archive was generated by hypermail 2.3.0 : Thu Jun 11 2020 - 11:00:36 CEST