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:
Sam Lantinga 2013-08-07 00:10:31 -07:00
parent 73a2e37abb
commit 40b7af6399

View file

@ -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);
}
}