Skip to content

Commit

Permalink
When updating grab state, only activate windows that are grabbed, ful…
Browse files Browse the repository at this point in the history
…lscreen, and shown.

Fixes #5371
  • Loading branch information
slouken committed Mar 17, 2022
1 parent e5f4545 commit 4e784fc
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/video/windows/SDL_windowswindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,13 +859,10 @@ WIN_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
{
WIN_UpdateClipCursor(window);

if (window->flags & SDL_WINDOW_FULLSCREEN) {
UINT flags = SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOSIZE;

if (!(window->flags & SDL_WINDOW_SHOWN)) {
flags |= SWP_NOACTIVATE;
}
WIN_SetWindowPositionInternal(_this, window, flags);
if (grabbed &&
(window->flags & SDL_WINDOW_FULLSCREEN) &&
(window->flags & SDL_WINDOW_SHOWN)) {
WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOSIZE);
}
}

Expand Down

0 comments on commit 4e784fc

Please sign in to comment.