From d65d9950f27d7511d2dc62999fcf0733a0fda416 Mon Sep 17 00:00:00 2001 From: Umur Gedik Date: Thu, 27 Jul 2017 14:04:04 +0900 Subject: [PATCH] Fixes window inner size calc for hidpi windows X11 X11 always return the geometry in pixel units. Since window.get_inner_size returns the size in points in other window manager implementations X11 should also return in points instead of pixels. --- src/platform/linux/x11/window.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/linux/x11/window.rs b/src/platform/linux/x11/window.rs index f5fa6794..7e2ddfe1 100644 --- a/src/platform/linux/x11/window.rs +++ b/src/platform/linux/x11/window.rs @@ -535,7 +535,7 @@ impl Window { #[inline] pub fn get_inner_size(&self) -> Option<(u32, u32)> { - self.get_geometry().map(|(_, _, w, h, _)| (w, h)) + self.get_geometry().map(|(_, _, w, h, _)| ((w as f32 / self.hidpi_factor()) as u32, (h as f32 / self.hidpi_factor()) as u32)) } #[inline]