Subject: 8-bit icon names needs conversion

From: Alexander Kotelnikov <[email-masked]>
Date: Fri, 12 Jan 2001 20:14:20 +0300

Hello fvwm-workers!

For unknown to me reasons WMName is converted from X internal
representaion only if I configure fvwm with --enable-kanji.

But WMIconName is not converted anyway. Attached patch (against current CVS)
fixes this problem.

-- 
Alexander Kotelnikov
Saint-Petersburg, Russia
? debian
? configure-stamp
? build-stamp
? icon_i18n.diff
Index: fvwm/add_window.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/add_window.c,v
retrieving revision 1.196
diff -u -u -r1.196 add_window.c
--- fvwm/add_window.c	2001/01/09 10:04:27	1.196
+++ fvwm/add_window.c	2001/01/12 16:43:14
@@ -976,6 +976,9 @@
 void setup_icon(FvwmWindow *tmp_win, window_style *pstyle)
 {
   XTextProperty text_prop;
+  /* [email-masked] */
+  char** icon_list;
+  int icon_num;    
 
   /* find a suitable icon pixmap */
   if((tmp_win->wmhints) && (tmp_win->wmhints->flags & IconWindowHint))
@@ -1008,7 +1011,24 @@
   /* icon name */
   if (XGetWMIconName(dpy, tmp_win->w, &text_prop))
   {
-    tmp_win->icon_name = (char *)text_prop.value;
+  /* [email-masked] */
+    if (text_prop.encoding == XA_STRING)
+      tmp_win->icon_name = (char *)text_prop.value;
+    else
+    {
+      if (XmbTextPropertyToTextList(dpy, &text_prop, &icon_list, &icon_num) >= Success)
+      {
+	XFree(text_prop.value);
+	tmp_win->icon_name = *icon_list;
+      }
+      else
+      {
+        if(icon_list) XFreeStringList(icon_list);
+	XFree(text_prop.value);
+	if (XGetWMIconName(dpy, tmp_win->w, &text_prop))
+	  tmp_win->icon_name = (char *)text_prop.value;
+      }
+    }
   }
   else
   {

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 12 Jan 2001 21:46:06 +0100

> But WMIconName is not converted anyway. Attached patch (against current CVS)

Thanks for the info, I've fixed the problem in a more general way.

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]