Skip to content

Commit

Permalink
Fix window can't be hidden when maximized
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Yu Wei committed May 7, 2022
1 parent b7e41fe commit 095e757
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changes/flag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": patch
---

Fix window can't be hidden when maximized.
12 changes: 5 additions & 7 deletions src/platform_impl/windows/window_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,11 @@ impl WindowFlags {

if diff.contains(WindowFlags::MAXIMIZED) || new.contains(WindowFlags::MAXIMIZED) {
unsafe {
ShowWindow(
window,
match new.contains(WindowFlags::MAXIMIZED) {
true => SW_MAXIMIZE,
false => SW_RESTORE,
},
);
if new.contains(WindowFlags::MAXIMIZED) {
ShowWindow(window, SW_MAXIMIZE);
} else if new.contains(WindowFlags::VISIBLE) {
ShowWindow(window, SW_RESTORE);
}
}
}

Expand Down

0 comments on commit 095e757

Please sign in to comment.