From bd4a1811629fa7068e8f28909f37d7f8ea90026e Mon Sep 17 00:00:00 2001 From: Serg Tereshchenko Date: Mon, 16 Aug 2021 22:29:53 +0300 Subject: [PATCH] fix(renderer): Force grid redraw on startup with --maximized flag Refs #892 --- src/window/window_wrapper/mod.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/window/window_wrapper/mod.rs b/src/window/window_wrapper/mod.rs index 30d64e2..defa96e 100644 --- a/src/window/window_wrapper/mod.rs +++ b/src/window/window_wrapper/mod.rs @@ -176,11 +176,16 @@ impl GlutinWindowWrapper { } if self.saved_grid_size.is_none() && !window.is_maximized() { - let size = SETTINGS.get::().geometry; - window.set_inner_size(self.renderer.grid_renderer.convert_grid_to_physical(size)); - self.saved_grid_size = Some(size); + let settings = SETTINGS.get::(); + window.set_inner_size( + self.renderer + .grid_renderer + .convert_grid_to_physical(settings.geometry), + ); + self.saved_grid_size = Some(settings.geometry); // Font change at startup is ignored, so grid size (and startup screen) could be preserved. - font_changed = false; + // But only when --maximize is not used. With maximized window we should redraw grid. + font_changed = settings.maximized; } let new_size = window.inner_size();