mirror of
https://github.com/wez/wezterm.git
synced 2024-11-30 06:03:39 +03:00
window: x11: explicitly set titles in utf8
closes: https://github.com/wez/wezterm/issues/673
This commit is contained in:
parent
8237dfc8c6
commit
1415d16c9f
@ -20,6 +20,7 @@ As features stabilize some brief notes about them will accumulate here.
|
||||
* Fixed: `wezterm ssh HOST` no longer overrides the `User` config specified by `~/.ssh/config`
|
||||
* Fixed: X11: detect when gnome DPI scaling changes [#667](https://github.com/wez/wezterm/issues/667)
|
||||
* Fixed: potential panic when pasting large amounts of multi-byte text [#668](https://github.com/wez/wezterm/issues/668)
|
||||
* Fixed: X11: non-ascii text could appear mangled in titlebars [#673](https://github.com/wez/wezterm/issues/673)
|
||||
|
||||
### 20210405-110924-a5bb5be8
|
||||
|
||||
|
@ -870,7 +870,22 @@ impl WindowOpsMut for XWindowInner {
|
||||
|
||||
/// Change the title for the window manager
|
||||
fn set_title(&mut self, title: &str) {
|
||||
xcb_util::icccm::set_wm_name(self.conn().conn(), self.window_id, title);
|
||||
// Ideally, we'd simply call this:
|
||||
// xcb_util::icccm::set_wm_name(self.conn().conn(), self.window_id, title);
|
||||
// However, it uses ATOM_STRING internally, rather than UTF8_STRING
|
||||
// and will mangle non-ascii characters in the title, so we call the
|
||||
// underlying function for ourslves:
|
||||
|
||||
unsafe {
|
||||
xcb_util::ffi::icccm::xcb_icccm_set_wm_name(
|
||||
self.conn().conn().get_raw_conn(),
|
||||
self.window_id,
|
||||
self.conn().atom_utf8_string,
|
||||
8,
|
||||
title.len() as u32,
|
||||
title.as_bytes().as_ptr() as *const _,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_icon(&mut self, image: &dyn BitmapImage) {
|
||||
|
Loading…
Reference in New Issue
Block a user