Enlightenment CVS committal

Author  : xcomputerman
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_x


Modified Files:
        ecore_x_window.c ecore_x_window_prop.c 


Log Message:
WM_NAME and WM_CLIENT_MACHINE should not be UTF8 strings, use proper
Xlib functions instead of manually setting the string property.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ecore_x_window.c    7 Feb 2004 00:50:54 -0000       1.10
+++ ecore_x_window.c    15 Feb 2004 22:33:55 -0000      1.11
@@ -180,16 +180,23 @@
 {
    long pid;
    char buf[MAXHOSTNAMELEN];
+   char *hostname[1];
    int argc;
    char **argv;
+   XTextProperty xprop;
 
    /*
     * Set WM_CLIENT_MACHINE.
     */
    gethostname(buf, MAXHOSTNAMELEN);
    buf[MAXHOSTNAMELEN - 1] = '\0';
-   ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_client_machine,
-                                 (char *)buf);
+   hostname[0] = buf;
+   /* The ecore function uses UTF8 which Xlib may not like (especially
+    * with older clients) */
+   /* ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_client_machine,
+                                 (char *)buf); */
+   if (XStringListToTextProperty(hostname, 1, &xprop))
+      XSetWMClientMachine(_ecore_x_disp, win, &xprop);
 
    /*
     * Set _NET_WM_PID
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window_prop.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- ecore_x_window_prop.c       15 Feb 2004 21:37:34 -0000      1.34
+++ ecore_x_window_prop.c       15 Feb 2004 22:33:55 -0000      1.35
@@ -202,7 +202,16 @@
 void
 ecore_x_window_prop_title_set(Ecore_X_Window win, const char *t)
 {
-   ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_name, (char *)t);
+   char *list[1];
+   XTextProperty xprop;
+   
+   list[0] = (char *) t;
+   
+   /* Xlib may not like the UTF8 String */
+   /* ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_name, (char *)t); */
+   if (XStringListToTextProperty(list, 1, &xprop))
+      XSetWMName(_ecore_x_disp, win, &xprop);
+            
    ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_name, (char *)t);
 }
 




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to