diff --git a/docs/changelog.md b/docs/changelog.md index 97d546004..0fc83b9e8 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -18,6 +18,7 @@ As features stabilize some brief notes about them will accumulate here. * Attaching multiplexer domains now attaches the first window as a tab in the active window, rather than opening a new window. [#1874](https://github.com/wez/wezterm/issues/1874) * [AttachDomain](config/lua/keyassignment/AttachDomain.md) and [DetachDomain](config/lua/keyassignment/DetachDomain.md) key assignments * Specifying a domain name in a [SpawnCommand](config/lua/SpawnCommand.md) will cause that domain to be attached if it is in the detached state. This is useful when combined with [SwitchToWorkspace](config/lua/keyassignment/SwitchToWorkspace.md). +* X11: wezterm now sets `_NET_WM_NAME` in addition to `WM_NAME` for clients that don't know how to fallback #### Changed * Debian packages now register wezterm as an alternative for `x-terminal-emulator`. Thanks to [@xpufx](https://github.com/xpufx)! [#1883](https://github.com/wez/wezterm/pull/1883) diff --git a/window/src/os/x11/window.rs b/window/src/os/x11/window.rs index d2ec25fe9..ccc54a7d4 100644 --- a/window/src/os/x11/window.rs +++ b/window/src/os/x11/window.rs @@ -1043,9 +1043,11 @@ impl XWindowInner { // and will mangle non-ascii characters in the title, so we call the // underlying function for ourslves: + let conn = self.conn(); + unsafe { xcb_util::ffi::icccm::xcb_icccm_set_wm_name( - self.conn().conn().get_raw_conn(), + conn.conn().get_raw_conn(), self.window_id, self.conn().atom_utf8_string, 8, @@ -1053,6 +1055,18 @@ impl XWindowInner { title.as_bytes().as_ptr() as *const _, ); } + + // Also set EWMH _NET_WM_NAME, as some clients don't correctly + // fall back to reading WM_NAME + xcb::xproto::change_property( + &conn, + xcb::xproto::PROP_MODE_REPLACE as u8, + self.window_id, + conn.ewmh_conn().WM_NAME(), + conn.atom_utf8_string, + 8, /* 8-bit string data */ + title.as_bytes(), + ); } fn set_text_cursor_position(&mut self, cursor: Rect) {