src/video/SDL_video.c
changeset 6214 b1a71f8189a6
parent 6188 e82023802002
child 6260 fd494c5f305b
     1.1 --- a/src/video/SDL_video.c	Sat Jan 14 00:49:25 2012 -0500
     1.2 +++ b/src/video/SDL_video.c	Sat Jan 14 01:38:11 2012 -0500
     1.3 @@ -1932,6 +1932,17 @@
     1.4  
     1.5      CHECK_WINDOW_MAGIC(window, );
     1.6  
     1.7 +    /* Restore video mode, etc. */
     1.8 +    SDL_HideWindow(window);
     1.9 +
    1.10 +    /* Make sure this window no longer has focus */
    1.11 +    if (SDL_GetKeyboardFocus() == window) {
    1.12 +        SDL_SetKeyboardFocus(NULL);
    1.13 +    }
    1.14 +    if (SDL_GetMouseFocus() == window) {
    1.15 +        SDL_SetMouseFocus(NULL);
    1.16 +    }
    1.17 +
    1.18      /* make no context current if this is the current context window. */
    1.19      if (window->flags & SDL_WINDOW_OPENGL) {
    1.20          if (_this->current_glwin == window) {
    1.21 @@ -1939,9 +1950,6 @@
    1.22          }
    1.23      }
    1.24  
    1.25 -    /* Restore video mode, etc. */
    1.26 -    SDL_HideWindow(window);
    1.27 -
    1.28      if (window->surface) {
    1.29          window->surface->flags &= ~SDL_DONTFREE;
    1.30          SDL_FreeSurface(window->surface);