mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
Preserve with_maximized on windows (#1515)
This commit is contained in:
parent
78a62ec547
commit
aabe42d252
|
@ -1,5 +1,7 @@
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
- On Windows, fix `WindowBuilder::with_maximized` being ignored.
|
||||||
|
|
||||||
# 0.22.1 (2020-04-16)
|
# 0.22.1 (2020-04-16)
|
||||||
|
|
||||||
- On X11, fix `ResumeTimeReached` being fired too early.
|
- On X11, fix `ResumeTimeReached` being fired too early.
|
||||||
|
|
|
@ -728,8 +728,6 @@ unsafe fn init<T: 'static>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window_flags.set(WindowFlags::MAXIMIZED, attributes.maximized);
|
|
||||||
|
|
||||||
// If the system theme is dark, we need to set the window theme now
|
// If the system theme is dark, we need to set the window theme now
|
||||||
// before we update the window flags (and possibly show the
|
// before we update the window flags (and possibly show the
|
||||||
// window for the first time).
|
// window for the first time).
|
||||||
|
@ -757,6 +755,11 @@ unsafe fn init<T: 'static>(
|
||||||
.inner_size
|
.inner_size
|
||||||
.unwrap_or_else(|| PhysicalSize::new(1024, 768).into());
|
.unwrap_or_else(|| PhysicalSize::new(1024, 768).into());
|
||||||
win.set_inner_size(dimensions);
|
win.set_inner_size(dimensions);
|
||||||
|
if attributes.maximized {
|
||||||
|
// Need to set MAXIMIZED after setting `inner_size` as
|
||||||
|
// `Window::set_inner_size` changes MAXIMIZED to false.
|
||||||
|
win.set_maximized(true);
|
||||||
|
}
|
||||||
win.set_visible(attributes.visible);
|
win.set_visible(attributes.visible);
|
||||||
|
|
||||||
if let Some(_) = attributes.fullscreen {
|
if let Some(_) = attributes.fullscreen {
|
||||||
|
|
Loading…
Reference in a new issue