Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed incorrect window state if the window is created grabbed. We don…
…'t want to activate the window if it isn't shown yet.
  • Loading branch information
slouken committed Aug 7, 2013
1 parent 83da1c5 commit 0a4bc0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/video/windows/SDL_windowswindow.c
Expand Up @@ -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;
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 0a4bc0f

Please sign in to comment.