refactor: Refactor initial resize fix

window.is_maximized() returns false on startup, using settings instead.

Refs #892
macos-click-through
Serg Tereshchenko 3 years ago
parent 76eab1d676
commit 55179e43c3

@ -175,8 +175,8 @@ impl GlutinWindowWrapper {
return; return;
} }
if self.saved_grid_size.is_none() && !window.is_maximized() { let settings = SETTINGS.get::<CmdLineSettings>();
let settings = SETTINGS.get::<CmdLineSettings>(); if self.saved_grid_size.is_none() && !settings.maximized {
window.set_inner_size( window.set_inner_size(
self.renderer self.renderer
.grid_renderer .grid_renderer
@ -185,7 +185,7 @@ impl GlutinWindowWrapper {
self.saved_grid_size = Some(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 change at startup is ignored, so grid size (and startup screen) could be preserved.
// But only when --maximize is not used. With maximized window we should redraw grid. // But only when --maximize is not used. With maximized window we should redraw grid.
font_changed = settings.maximized; font_changed = false;
} }
let new_size = window.inner_size(); let new_size = window.inner_size();

Loading…
Cancel
Save