mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-26 03:36:32 +11:00
Fix Window visibility regression (#1994)
On Windows, set windows visible on init before position update Ensure that the style change is correctly applied, triggering the necessary events.
This commit is contained in:
parent
1972eb952d
commit
b87757c552
1 changed files with 4 additions and 1 deletions
|
@ -882,6 +882,10 @@ unsafe fn post_init<T: 'static>(
|
||||||
thread_executor: event_loop.create_thread_executor(),
|
thread_executor: event_loop.create_thread_executor(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Set visible before setting the size to ensure the
|
||||||
|
// attribute is correctly applied.
|
||||||
|
win.set_visible(attributes.visible);
|
||||||
|
|
||||||
let dimensions = attributes
|
let dimensions = attributes
|
||||||
.inner_size
|
.inner_size
|
||||||
.unwrap_or_else(|| PhysicalSize::new(800, 600).into());
|
.unwrap_or_else(|| PhysicalSize::new(800, 600).into());
|
||||||
|
@ -891,7 +895,6 @@ unsafe fn post_init<T: 'static>(
|
||||||
// `Window::set_inner_size` changes MAXIMIZED to false.
|
// `Window::set_inner_size` changes MAXIMIZED to false.
|
||||||
win.set_maximized(true);
|
win.set_maximized(true);
|
||||||
}
|
}
|
||||||
win.set_visible(attributes.visible);
|
|
||||||
|
|
||||||
if let Some(_) = attributes.fullscreen {
|
if let Some(_) = attributes.fullscreen {
|
||||||
win.set_fullscreen(attributes.fullscreen);
|
win.set_fullscreen(attributes.fullscreen);
|
||||||
|
|
Loading…
Add table
Reference in a new issue