mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-19 18:41:56 +03:00
gpui: Fix window title special characters display on X11 (#9994)
Before: ![image](https://github.com/zed-industries/zed/assets/13511978/f12a144a-5c41-44e9-8422-aa73ea54fb9c) After: ![image](https://github.com/zed-industries/zed/assets/13511978/45e9b701-77a8-4e63-9481-dab895a347f7) Release Notes: - Fixed window title special characters display on X11. --------- Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
parent
dffddaec4c
commit
4b40e83b8b
@ -33,8 +33,10 @@ use super::X11Display;
|
|||||||
|
|
||||||
x11rb::atom_manager! {
|
x11rb::atom_manager! {
|
||||||
pub XcbAtoms: AtomsCookie {
|
pub XcbAtoms: AtomsCookie {
|
||||||
|
UTF8_STRING,
|
||||||
WM_PROTOCOLS,
|
WM_PROTOCOLS,
|
||||||
WM_DELETE_WINDOW,
|
WM_DELETE_WINDOW,
|
||||||
|
_NET_WM_NAME,
|
||||||
_NET_WM_STATE,
|
_NET_WM_STATE,
|
||||||
_NET_WM_STATE_MAXIMIZED_VERT,
|
_NET_WM_STATE_MAXIMIZED_VERT,
|
||||||
_NET_WM_STATE_MAXIMIZED_HORZ,
|
_NET_WM_STATE_MAXIMIZED_HORZ,
|
||||||
@ -76,7 +78,7 @@ pub struct Callbacks {
|
|||||||
|
|
||||||
pub(crate) struct X11WindowState {
|
pub(crate) struct X11WindowState {
|
||||||
raw: RawWindow,
|
raw: RawWindow,
|
||||||
|
atoms: XcbAtoms,
|
||||||
bounds: Bounds<i32>,
|
bounds: Bounds<i32>,
|
||||||
scale_factor: f32,
|
scale_factor: f32,
|
||||||
renderer: BladeRenderer,
|
renderer: BladeRenderer,
|
||||||
@ -238,6 +240,7 @@ impl X11WindowState {
|
|||||||
bounds: params.bounds.map(|v| v.0),
|
bounds: params.bounds.map(|v| v.0),
|
||||||
scale_factor: 1.0,
|
scale_factor: 1.0,
|
||||||
renderer: BladeRenderer::new(gpu, gpu_extent),
|
renderer: BladeRenderer::new(gpu, gpu_extent),
|
||||||
|
atoms: *atoms,
|
||||||
|
|
||||||
input_handler: None,
|
input_handler: None,
|
||||||
}
|
}
|
||||||
@ -442,6 +445,16 @@ impl PlatformWindow for X11Window {
|
|||||||
title.as_bytes(),
|
title.as_bytes(),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
self.xcb_connection
|
||||||
|
.change_property8(
|
||||||
|
xproto::PropMode::REPLACE,
|
||||||
|
self.x_window,
|
||||||
|
self.state.borrow().atoms._NET_WM_NAME,
|
||||||
|
self.state.borrow().atoms.UTF8_STRING,
|
||||||
|
title.as_bytes(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo(linux)
|
// todo(linux)
|
||||||
|
Loading…
Reference in New Issue
Block a user