mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-23 02:16:33 +11:00
Fix Window::set_visible not setting internal flags correctly (#1345)
This commit is contained in:
parent
468b6b83ec
commit
e4451d6786
2 changed files with 8 additions and 8 deletions
|
@ -16,6 +16,7 @@
|
||||||
- `RedrawEventsCleared` is issued after each set of `RedrawRequested` events.
|
- `RedrawEventsCleared` is issued after each set of `RedrawRequested` events.
|
||||||
- Implement synthetic window focus key events on Windows.
|
- Implement synthetic window focus key events on Windows.
|
||||||
- **Breaking**: Change `ModifiersState` to a `bitflags` struct.
|
- **Breaking**: Change `ModifiersState` to a `bitflags` struct.
|
||||||
|
- On Windows, fix `Window::set_visible` not setting internal flags correctly. This resulted in some weird behavior.
|
||||||
|
|
||||||
# 0.20.0 Alpha 5 (2019-12-09)
|
# 0.20.0 Alpha 5 (2019-12-09)
|
||||||
|
|
||||||
|
|
|
@ -127,14 +127,13 @@ impl Window {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_visible(&self, visible: bool) {
|
pub fn set_visible(&self, visible: bool) {
|
||||||
match visible {
|
let window_state = Arc::clone(&self.window_state);
|
||||||
true => unsafe {
|
let window = self.window.clone();
|
||||||
winuser::ShowWindow(self.window.0, winuser::SW_SHOW);
|
self.thread_executor.execute_in_thread(move || {
|
||||||
},
|
WindowState::set_window_flags(window_state.lock(), window.0, |f| {
|
||||||
false => unsafe {
|
f.set(WindowFlags::VISIBLE, visible)
|
||||||
winuser::ShowWindow(self.window.0, winuser::SW_HIDE);
|
});
|
||||||
},
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Add table
Reference in a new issue