Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

linux: fix getting the initial content size (#7604)

Dzmitry Malyshau2b383b854a03
diff --git a/crates/gpui/src/platform/linux/window.rs b/crates/gpui/src/platform/linux/window.rs
index a9c00cc7fc0..774c4a537ca 100644
--- a/crates/gpui/src/platform/linux/window.rs
+++ b/crates/gpui/src/platform/linux/window.rs
@@ -192,10 +192,6 @@ impl LinuxWindowState {
xcb_connection.send_request(&x::MapWindow { window: x_window });
xcb_connection.flush().unwrap();
- //Warning: it looks like this reported size is immediately invalidated
- // on some platforms, followed by a "ConfigureNotify" event.
- let gpu_extent = query_render_extent(xcb_connection, x_window);
-
let raw = RawWindow {
connection: as_raw_xcb_connection::AsRawXcbConnection::as_raw_xcb_connection(
xcb_connection,
@@ -217,6 +213,10 @@ impl LinuxWindowState {
.unwrap(),
);
+ // Note: this has to be done after the GPU init, or otherwise
+ // the sizes are immediately invalidated.
+ let gpu_extent = query_render_extent(&xcb_connection, x_window);
+
Self {
xcb_connection: Arc::clone(xcb_connection),
display: Rc::new(LinuxDisplay::new(xcb_connection, x_screen_index)),