ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/main.C
(Generate patch)

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.327 by root, Sun May 23 00:25:48 2010 UTC vs.
Revision 1.328 by sf-exg, Mon Jul 19 16:43:21 2010 UTC

754 prop, XA_STRING, 8, PropModeReplace, 754 prop, XA_STRING, 8, PropModeReplace,
755 (const unsigned char *)str, len >= 0 ? len : strlen (str)); 755 (const unsigned char *)str, len >= 0 ? len : strlen (str));
756} 756}
757 757
758void 758void
759rxvt_term::set_mbstring_property (Atom prop, const char *str, int len)
760{
761 XTextProperty ct;
762
763 if (XmbTextListToTextProperty (dpy, (char **)&str, 1, XStdICCTextStyle, &ct) >= 0)
764 {
765 XSetTextProperty (dpy, parent[0], &ct, prop);
766 XFree (ct.value);
767 }
768}
769
770void
759rxvt_term::set_utf8_property (Atom prop, const char *str, int len) 771rxvt_term::set_utf8_property (Atom prop, const char *str, int len)
760{ 772{
761 wchar_t *ws = rxvt_mbstowcs (str, len); 773 wchar_t *ws = rxvt_mbstowcs (str, len);
762 char *s = rxvt_wcstoutf8 (ws); 774 char *s = rxvt_wcstoutf8 (ws);
763 775
773/*----------------------------------------------------------------------*/ 785/*----------------------------------------------------------------------*/
774/* xterm sequences - title, iconName, color (exptl) */ 786/* xterm sequences - title, iconName, color (exptl) */
775void 787void
776rxvt_term::set_title (const char *str) 788rxvt_term::set_title (const char *str)
777{ 789{
778 set_string_property (XA_WM_NAME, str); 790 set_mbstring_property (XA_WM_NAME, str);
779#if ENABLE_EWMH 791#if ENABLE_EWMH
780 set_utf8_property (xa[XA_NET_WM_NAME], str); 792 set_utf8_property (xa[XA_NET_WM_NAME], str);
781#endif 793#endif
782} 794}
783 795
784void 796void
785rxvt_term::set_icon_name (const char *str) 797rxvt_term::set_icon_name (const char *str)
786{ 798{
787 set_string_property (XA_WM_ICON_NAME, str); 799 set_mbstring_property (XA_WM_ICON_NAME, str);
788#if ENABLE_EWMH 800#if ENABLE_EWMH
789 set_utf8_property (xa[XA_NET_WM_ICON_NAME], str); 801 set_utf8_property (xa[XA_NET_WM_ICON_NAME], str);
790#endif 802#endif
791} 803}
792 804

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines