diff --git a/crates/gpui/src/platform/linux/x11/window.rs b/crates/gpui/src/platform/linux/x11/window.rs index 93a9003be641e0f7bb44e324672c1992ec5e2d28..acfdcb068d42e6b342a8cde69e54421b972e3a4a 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 { - // 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) {