From e2f16f4f58b82dd594942fc92e8dc7dff953ace9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=96R=C3=96K=20Attila?= Date: Sat, 4 Dec 2021 14:56:01 +0100 Subject: [PATCH] desktop: Work around the tiny winit window issue on KDE Plasma with Wayland --- desktop/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/desktop/src/main.rs b/desktop/src/main.rs index 10ece6294924..80d756cd0184 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -244,9 +244,15 @@ impl App { .with_title(title) .with_window_icon(Some(icon)) .with_inner_size(window_size) + .with_min_inner_size(window_size) .with_max_inner_size(LogicalSize::new(i16::MAX, i16::MAX)) .build(&event_loop)?; + // Setting and resetting `min_inner_size` is a workaround for a winit and/or KDE Plasma + // bug on Wayland, resulting in the window being shown initially in 0x0 size, despite + // of the correct `inner_size` being passed to the builder. + window.set_min_inner_size(None::>); + let viewport_size = window.inner_size(); let viewport_scale_factor = window.scale_factor();