Replace lazy window message ids with a slimmer version (#2598)

This commit is contained in:
John Nunley 2023-02-04 06:38:21 -08:00 committed by GitHub
parent 69d6076310
commit 5ba6bdef49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 101 additions and 40 deletions

View file

@ -391,7 +391,12 @@ impl WindowFlags {
let (style, style_ex) = new.to_window_styles();
unsafe {
SendMessageW(window, *event_loop::SET_RETAIN_STATE_ON_SIZE_MSG_ID, 1, 0);
SendMessageW(
window,
event_loop::SET_RETAIN_STATE_ON_SIZE_MSG_ID.get(),
1,
0,
);
// This condition is necessary to avoid having an unrestorable window
if !new.contains(WindowFlags::MINIMIZED) {
@ -412,7 +417,12 @@ impl WindowFlags {
// Refresh the window frame
SetWindowPos(window, 0, 0, 0, 0, 0, flags);
SendMessageW(window, *event_loop::SET_RETAIN_STATE_ON_SIZE_MSG_ID, 0, 0);
SendMessageW(
window,
event_loop::SET_RETAIN_STATE_ON_SIZE_MSG_ID.get(),
0,
0,
);
}
}
}