From 3dfff613b9164b16974a0423c82f7ccb649015be Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 27 Mar 2022 18:16:55 +0200 Subject: [PATCH] Use physical sizes in X11 window resize And update the window info for any future events. --- src/x11/window.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/x11/window.rs b/src/x11/window.rs index faebe44..c4d0314 100644 --- a/src/x11/window.rs +++ b/src/x11/window.rs @@ -390,12 +390,15 @@ impl Window { } pub fn resize(&mut self, size: Size) { + let scaling = self.window_info.scale(); + self.window_info = WindowInfo::from_logical_size(size, scaling); + xcb::configure_window( &self.xcb_connection.conn, self.window_id, &[ - (xcb::CONFIG_WINDOW_WIDTH as u16, size.width.round() as u32), - (xcb::CONFIG_WINDOW_HEIGHT as u16, size.height.round() as u32), + (xcb::CONFIG_WINDOW_WIDTH as u16, self.window_info.physical_size().width), + (xcb::CONFIG_WINDOW_HEIGHT as u16, self.window_info.physical_size().height), ], ); self.xcb_connection.conn.flush();