… | |
… | |
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 | |
758 | void |
758 | void |
|
|
759 | rxvt_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 | |
|
|
770 | void |
759 | rxvt_term::set_utf8_property (Atom prop, const char *str, int len) |
771 | rxvt_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) */ |
775 | void |
787 | void |
776 | rxvt_term::set_title (const char *str) |
788 | rxvt_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 | |
784 | void |
796 | void |
785 | rxvt_term::set_icon_name (const char *str) |
797 | rxvt_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 | |