Fixed incorrect window state if the window is created grabbed. We don't want to activate the window if it isn't shown yet.
authorSam Lantinga
Wed, 07 Aug 2013 00:10:31 -0700
changeset 7584864eca4d27a7
parent 7583 7e053ad01aa3
child 7585 7fd59fc01ee7
Fixed incorrect window state if the window is created grabbed. We don't want to activate the window if it isn't shown yet.
src/video/windows/SDL_windowswindow.c
     1.1 --- a/src/video/windows/SDL_windowswindow.c	Tue Aug 06 22:55:55 2013 -0700
     1.2 +++ b/src/video/windows/SDL_windowswindow.c	Wed Aug 07 00:10:31 2013 -0700
     1.3 @@ -559,7 +559,7 @@
     1.4          HWND top;
     1.5          SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
     1.6          HWND hwnd = data->hwnd;
     1.7 -        UINT flags = SWP_NOMOVE | SWP_NOSIZE;
     1.8 +        UINT flags = SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOSIZE;
     1.9  
    1.10          if ( SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS ) ) {
    1.11              top = HWND_TOPMOST;
    1.12 @@ -568,6 +568,10 @@
    1.13              flags |= SWP_NOZORDER;
    1.14          }
    1.15  
    1.16 +        if (!(window->flags & SDL_WINDOW_SHOWN)) {
    1.17 +            flags |= SWP_NOACTIVATE;
    1.18 +        }
    1.19 +
    1.20          SetWindowPos(hwnd, top, 0, 0, 0, 0, flags);
    1.21      }
    1.22  }