Fix 968: Invisible windows steal focus from visible windows Win32 (#968)

This commit is contained in:
chichid 2019-06-26 00:04:49 -04:00 committed by Osspial
parent 29e2481597
commit 0e20973bdb
3 changed files with 8 additions and 3 deletions

View file

@ -2,6 +2,7 @@
- Change `Event::Suspended(true / false)` to `Event::Suspended` and `Event::Resumed`. - Change `Event::Suspended(true / false)` to `Event::Suspended` and `Event::Resumed`.
- On X11, fix sanity check which checks that a monitor's reported width and height (in millimeters) are non-zero when calculating the DPI factor. - On X11, fix sanity check which checks that a monitor's reported width and height (in millimeters) are non-zero when calculating the DPI factor.
- On Windows, when a window is initially invisible, it won't take focus from the existing visible windows.
# 0.20.0 Alpha 1 # 0.20.0 Alpha 1

View file

@ -271,7 +271,8 @@ impl Window {
winuser::SWP_ASYNCWINDOWPOS winuser::SWP_ASYNCWINDOWPOS
| winuser::SWP_NOZORDER | winuser::SWP_NOZORDER
| winuser::SWP_NOREPOSITION | winuser::SWP_NOREPOSITION
| winuser::SWP_NOMOVE, | winuser::SWP_NOMOVE
| winuser::SWP_NOACTIVATE,
); );
winuser::UpdateWindow(self.window.0); winuser::UpdateWindow(self.window.0);
} }

View file

@ -307,7 +307,9 @@ impl WindowFlags {
y, y,
w, w,
h, h,
winuser::SWP_NOZORDER | winuser::SWP_FRAMECHANGED, winuser::SWP_NOZORDER
| winuser::SWP_FRAMECHANGED
| winuser::SWP_NOACTIVATE,
); );
} }
None => { None => {
@ -322,7 +324,8 @@ impl WindowFlags {
winuser::SWP_NOZORDER winuser::SWP_NOZORDER
| winuser::SWP_NOMOVE | winuser::SWP_NOMOVE
| winuser::SWP_NOSIZE | winuser::SWP_NOSIZE
| winuser::SWP_FRAMECHANGED, | winuser::SWP_FRAMECHANGED
| winuser::SWP_NOACTIVATE,
); );
} }
} }