summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/x11_common.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index fe27483f0a..c3fa16f2a9 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1363,8 +1363,13 @@ static void vo_x11_update_window_title(struct vo *vo)
vo_x11_set_property_string(vo, XA_WM_NAME, x11->window_title);
vo_x11_set_property_string(vo, XA_WM_ICON_NAME, x11->window_title);
- vo_x11_set_property_utf8(vo, XA(x11, _NET_WM_NAME), x11->window_title);
- vo_x11_set_property_utf8(vo, XA(x11, _NET_WM_ICON_NAME), x11->window_title);
+
+ /* _NET_WM_NAME and _NET_WM_ICON_NAME must be sanitized to UTF-8. */
+ void *tmp = talloc_new(NULL);
+ struct bstr b_title = bstr_sanitize_utf8_latin1(tmp, bstr0(x11->window_title));
+ vo_x11_set_property_utf8(vo, XA(x11, _NET_WM_NAME), b_title.start);
+ vo_x11_set_property_utf8(vo, XA(x11, _NET_WM_ICON_NAME), b_title.start);
+ talloc_free(tmp);
}
static void vo_x11_xembed_update(struct vo_x11_state *x11, int flags)