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.
This commit is contained in:
Umur Gedik 2017-07-27 14:04:04 +09:00
parent 3b7dbd01d0
commit d65d9950f2

View file

@ -535,7 +535,7 @@ impl Window {
#[inline] #[inline]
pub fn get_inner_size(&self) -> Option<(u32, u32)> { 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] #[inline]