Skip to content

Commit

Permalink
Retain WS_MAXIMZE when unminmizing a maximized window (rust-windowi…
Browse files Browse the repository at this point in the history
…ng#2581)

Co-authored-by: Markus Siglreithmaier <[email protected]>
  • Loading branch information
amrbashir and msiglreith authored Dec 9, 2022
1 parent 9f781bc commit 89eea64
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ And please only add new entries to the top of this list, right below the `# Unre

# Unreleased

- On Windows, retain `WS_MAXIMIZE` window style when un-minimizing a maximized window.
- On Windows, fix left mouse button release event not being sent after `Window::drag_window`.
- On macOS, run most actions on the main thread, which is strictly more correct, but might make multithreaded applications block slightly more.
- On macOS, fix panic when getting current monitor without any monitor attached.
Expand Down
1 change: 1 addition & 0 deletions examples/window_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ fn main() {
if minimized {
minimized = !minimized;
window.set_minimized(minimized);
window.focus_window();
}
}
VirtualKeyCode::V => {
Expand Down
1 change: 0 additions & 1 deletion src/platform_impl/windows/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,6 @@ unsafe fn public_window_callback_inner<T: 'static>(
w.set_window_flags_in_place(|f| f.set(WindowFlags::MAXIMIZED, maximized));
}
}

userdata.send_event(event);
0
}
Expand Down
4 changes: 3 additions & 1 deletion src/platform_impl/windows/window_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl WindowFlags {
self = self.mask();
new = new.mask();

let diff = self ^ new;
let mut diff = self ^ new;

if diff == WindowFlags::empty() {
return;
Expand Down Expand Up @@ -357,6 +357,8 @@ impl WindowFlags {
},
);
}

diff.remove(WindowFlags::MINIMIZED);
}

if diff.contains(WindowFlags::CLOSABLE) || new.contains(WindowFlags::CLOSABLE) {
Expand Down

0 comments on commit 89eea64

Please sign in to comment.