diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-05-04 15:49:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-04 15:49:54 -0400 |
commit | a5e70a2ac92806c5d773a76ac76912f9807eba2d (patch) | |
tree | 5f38d3579a75780ca0ed407ecfef8de30738714f /xwayland/xwm.c | |
parent | caf9f9022c32216da562f4ca6f6d8fb5c101d0ae (diff) | |
parent | cf10cbc00ca714e28b37118d42fd5af64e3bbf13 (diff) |
Merge pull request #953 from emersion/xwayland-utf8-title
Use UTF-8 xwayland window title if available
Diffstat (limited to 'xwayland/xwm.c')
-rw-r--r-- | xwayland/xwm.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c index b97a1753..7c9cd304 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -353,8 +353,10 @@ static void read_surface_title(struct wlr_xwm *xwm, return; } - // TODO: if reply->type == XCB_ATOM_STRING, uses latin1 encoding - // if reply->type == xwm->atoms[UTF8_STRING], uses utf8 encoding + bool is_utf8 = reply->type == xwm->atoms[UTF8_STRING]; + if (!is_utf8 && xsurface->has_utf8_title) { + return; + } size_t len = xcb_get_property_value_length(reply); char *title = xcb_get_property_value(reply); @@ -365,6 +367,7 @@ static void read_surface_title(struct wlr_xwm *xwm, } else { xsurface->title = NULL; } + xsurface->has_utf8_title = is_utf8; wlr_log(L_DEBUG, "XCB_ATOM_WM_NAME: %s", xsurface->title); wlr_signal_emit_safe(&xsurface->events.set_title, xsurface); |