From cc78ecb7ba7b0a0e114fa7ec4134509293787718 Mon Sep 17 00:00:00 2001 From: Konkitoman Date: Fri, 20 Oct 2023 15:07:56 +0300 Subject: [PATCH] Fix X11 invalid outer_position, inner_position, outer_size, inner_size, set_outer_position, set_inner_position and is making resizing smooter --- crates/egui-winit/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index 225dd3b33..9ba253407 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -171,6 +171,12 @@ impl State { self.egui_input.time = Some(self.start_time.elapsed().as_secs_f64()); + // TODO remove this in winit 0.29 + // This hack make the window outer_position and size to be valid, X11 Only + // That was happending because winit get the window state before the compositor adds decorations! + #[cfg(feature = "x11")] + window.set_maximized(window.is_maximized()); + // On Windows, a minimized window will have 0 width and height. // See: https://github.com/rust-windowing/winit/issues/208 // This solves an issue where egui window positions would be changed when minimizing on Windows.