repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: d7d98751b7385416ad1694b5f1fde6c312ba20d5: path_to: revision_to:
commit d7d98751b7385416ad1694b5f1fde6c312ba20d5 Author: Emanuele GiaquintaDate: Mon Jul 19 16:43:21 2010 +0000 Use COMPOUND_TEXT encoding for WM_NAME/WM_ICON_NAME value when it is not fully convertible to STRING, patch by James Cloos. diff --git a/Changes b/Changes
--- a/Changes
+++ b/Changes
@@ -21,6 +21,8 @@ TODO: perl-shell-window? perl-unix-socket?
TODO: - upgrade to libev-4.00.
+ - Use COMPOUND_TEXT encoding for WM_NAME/WM_ICON_NAME value when it
+ is not fully convertible to STRING (patch by James Cloos).
- fix a buffer overflow that would cause wrong key sequences to
be generated for numpad keys (introduced in 9.05).
- fix definition of sgr0 to work around limitations in luit.
diff --git a/src/main.C b/src/main.C
--- a/src/main.C
+++ b/src/main.C
@@ -755,6 +755,18 @@ rxvt_term::set_string_property (Atom prop, const char *str, int len)
(const unsigned char *)str, len >= 0 ? len : strlen (str));
}
+void
+rxvt_term::set_mbstring_property (Atom prop, const char *str, int len)
+{
+ XTextProperty ct;
+
+ if (XmbTextListToTextProperty (dpy, (char **)&str, 1, XStdICCTextStyle, &ct) >= 0)
+ {
+ XSetTextProperty (dpy, parent[0], &ct, prop);
+ XFree (ct.value);
+ }
+}
+
void
rxvt_term::set_utf8_property (Atom prop, const char *str, int len)
{
@@ -775,7 +787,7 @@ rxvt_term::set_utf8_property (Atom prop, const char *str, int len)
void
rxvt_term::set_title (const char *str)
{
- set_string_property (XA_WM_NAME, str);
+ set_mbstring_property (XA_WM_NAME, str);
#if ENABLE_EWMH
set_utf8_property (xa[XA_NET_WM_NAME], str);
#endif
@@ -784,7 +796,7 @@ rxvt_term::set_title (const char *str)
void
rxvt_term::set_icon_name (const char *str)
{
- set_string_property (XA_WM_ICON_NAME, str);
+ set_mbstring_property (XA_WM_ICON_NAME, str);
#if ENABLE_EWMH
set_utf8_property (xa[XA_NET_WM_ICON_NAME], str);
#endif
diff --git a/src/rxvt.h b/src/rxvt.h
--- a/src/rxvt.h +++ b/src/rxvt.h @@ -1310,6 +1310,7 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen void window_calc (unsigned int newwidth, unsigned int newheight); bool set_fonts (); void set_string_property (Atom prop, const char *str, int len = -1); + void set_mbstring_property (Atom prop, const char *str, int len = -1); void set_utf8_property (Atom prop, const char *str, int len = -1); void set_title (const char *str); void set_icon_name (const char *str);
-----END OF PAGE-----