From d316c6ae54cf13a53b24215259b49cadb89510c9 Mon Sep 17 00:00:00 2001 From: Billy Messenger Date: Wed, 14 Jul 2021 11:44:00 -0500 Subject: [PATCH] send initial window resized event in x11 --- src/x11/window.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/x11/window.rs b/src/x11/window.rs index 9128f65..aebed48 100644 --- a/src/x11/window.rs +++ b/src/x11/window.rs @@ -200,6 +200,13 @@ impl Window { let mut handler = build(&mut crate::Window::new(&mut window)); + // Send an initial window resized event so the use is alerted of + // the correct dpi scaling. + handler.on_event( + &mut crate::Window::new(&mut window), + Event::Window(WindowEvent::Resized(window_info)) + ); + let _ = tx.send(Ok(SendableRwh(window.raw_window_handle()))); window.run_event_loop(&mut handler);