[hackers] [lsw][patch] Better handling of window title with non-ascii chars

From: Julien Steinhauser <jul_AT_ldd.fr>
Date: Wed, 22 Nov 2017 22:47:39 +0100

Hello

I've seen window title with non-ascii chars incorrectly displayed,
using Xutf8TextPropertyToTextList instead of XmbTextPropertyToTextList
as in the diff below fixed it.

Regards

Julien

diff --git a/lsw.c b/lsw.c
index fc40fef..9a5bee1 100644
--- a/lsw.c
+++ b/lsw.c
_AT_@ -55,7 +55,7 @@ getname(Window win) {
         if(!XGetTextProperty(dpy, win, &prop, netwmname) || prop.nitems == 0)
                 if(!XGetWMName(dpy, win, &prop) || prop.nitems == 0)
                         return "";
- if(!XmbTextPropertyToTextList(dpy, &prop, &list, &n) && n > 0) {
+ if(!Xutf8TextPropertyToTextList(dpy, &prop, &list, &n) && n > 0) {
                 strncpy(buf, list[0], sizeof buf);
                 XFreeStringList(list);
         } else
Received on Wed Nov 22 2017 - 22:47:39 CET

This archive was generated by hypermail 2.3.0 : Wed Nov 22 2017 - 22:48:24 CET