mirror of
https://github.com/yawut/SDL.git
synced 2026-08-26 10:44:39 -05:00
Fixed incorrect window state if the window is created grabbed. We don't want to activate the window if it isn't shown yet.
This commit is contained in:
@@ -559,7 +559,7 @@ WIN_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
|
||||
HWND top;
|
||||
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
|
||||
HWND hwnd = data->hwnd;
|
||||
UINT flags = SWP_NOMOVE | SWP_NOSIZE;
|
||||
UINT flags = SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOSIZE;
|
||||
|
||||
if ( SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS ) ) {
|
||||
top = HWND_TOPMOST;
|
||||
@@ -568,6 +568,10 @@ WIN_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
|
||||
flags |= SWP_NOZORDER;
|
||||
}
|
||||
|
||||
if (!(window->flags & SDL_WINDOW_SHOWN)) {
|
||||
flags |= SWP_NOACTIVATE;
|
||||
}
|
||||
|
||||
SetWindowPos(hwnd, top, 0, 0, 0, 0, flags);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user