Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions winit-win32/src/window_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ impl WindowFlags {
return;
}

if new.contains(WindowFlags::VISIBLE) {
if new.contains(WindowFlags::VISIBLE)
&& !new.contains(WindowFlags::MAXIMIZED)
&& !new.contains(WindowFlags::MINIMIZED)
{
let flag = if !self.contains(WindowFlags::MARKER_ACTIVATE) {
self.set(WindowFlags::MARKER_ACTIVATE, true);
SW_SHOWNOACTIVATE
Expand Down Expand Up @@ -379,7 +382,9 @@ impl WindowFlags {
}
}

if diff.contains(WindowFlags::MAXIMIZED) || new.contains(WindowFlags::MAXIMIZED) {
if new.contains(WindowFlags::VISIBLE)
&& (diff.contains(WindowFlags::MAXIMIZED) || new.contains(WindowFlags::MAXIMIZED))
{
unsafe {
ShowWindow(window, match new.contains(WindowFlags::MAXIMIZED) {
true => SW_MAXIMIZE,
Expand All @@ -389,7 +394,9 @@ impl WindowFlags {
}

// Minimize operations should execute after maximize for proper window animations
if diff.contains(WindowFlags::MINIMIZED) {
if new.contains(WindowFlags::VISIBLE)
&& (diff.contains(WindowFlags::MINIMIZED) || new.contains(WindowFlags::MINIMIZED))
{
unsafe {
ShowWindow(window, match new.contains(WindowFlags::MINIMIZED) {
true => SW_MINIMIZE,
Expand Down
1 change: 1 addition & 0 deletions winit/src/changelog/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ changelog entry.
- On Wayland, switch from using the `ahash` hashing algorithm to `foldhash`.
- On macOS, fix borderless game presentation options not sticking after switching spaces.
- On macOS, fix IME being locked on (regardless of requests to disable) after being enabled once.
- On Windows, avoid briefly showing hidden windows when applying maximized or minimized state.
Loading