From c26507c322d8502cd69b88226b65f246f0862678 Mon Sep 17 00:00:00 2001 From: William Light Date: Mon, 14 Sep 2020 06:21:25 +0200 Subject: [PATCH] x11: fix potential missed resize events --- src/x11/window.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/x11/window.rs b/src/x11/window.rs index 558b7b0..952424e 100644 --- a/src/x11/window.rs +++ b/src/x11/window.rs @@ -311,10 +311,12 @@ impl Window { xcb::CONFIGURE_NOTIFY => { let event = unsafe { xcb::cast_event::(&event) }; - let (width, height) = (event.width() as u32, event.height() as u32); - if width != self.window_info.width || height != self.window_info.height { - self.new_size = Some((width, height)); + let new_size = (event.width() as u32, event.height() as u32); + let cur_size = (self.window_info.width, self.window_info.height); + + if self.new_size.is_some() || new_size != cur_size { + self.new_size = Some(new_size); } }