Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
gpui: Fix content size scaling regression on X11 (#49174)
Om Chillureed47f1017d52
diff --git a/crates/gpui/src/platform/linux/x11/window.rs b/crates/gpui/src/platform/linux/x11/window.rsindex 93a9003be64..acfdcb068d4 100644--- a/crates/gpui/src/platform/linux/x11/window.rs+++ b/crates/gpui/src/platform/linux/x11/window.rs@@ -28,8 +28,7 @@ use x11rb::{};use std::{- cell::RefCell, ffi::c_void, fmt::Display, num::NonZeroU32, ops::Div, ptr::NonNull, rc::Rc,- sync::Arc,+ cell::RefCell, ffi::c_void, fmt::Display, num::NonZeroU32, ptr::NonNull, rc::Rc, sync::Arc,};use super::{X11Display, XINPUT_ALL_DEVICE_GROUPS, XINPUT_ALL_DEVICES};@@ -1264,12 +1263,10 @@ impl PlatformWindow for X11Window {}fn content_size(&self) -> Size<Pixels> {- // We divide by the scale factor here because this value is queried to determine how much to draw,- // but it will be multiplied later by the scale to adjust for scaling.- let state = self.0.state.borrow();- state- .content_size()- .map(|size| size.div(state.scale_factor))+ // After the wgpu migration, X11WindowState::content_size() returns logical pixels+ // (bounds.size is already divided by scale_factor in set_bounds), so no further+ // division is needed here. This matches the Wayland implementation.+ self.0.state.borrow().content_size()}fn resize(&mut self, size: Size<Pixels>) {