Fixed creating fullscreen windows on Steam Link
authorSam Lantinga <slouken@libsdl.org>
Fri, 22 Jan 2016 13:12:16 -0800
changeset 100564f139e059592
parent 10055 b2fd76446eee
child 10057 1599a0012da5
Fixed creating fullscreen windows on Steam Link
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Sat Jan 16 21:58:49 2016 -0800
     1.2 +++ b/src/video/SDL_video.c	Fri Jan 22 13:12:16 2016 -0800
     1.3 @@ -1309,11 +1309,6 @@
     1.4  static void
     1.5  SDL_FinishWindowCreation(SDL_Window *window, Uint32 flags)
     1.6  {
     1.7 -    window->windowed.x = window->x;
     1.8 -    window->windowed.y = window->y;
     1.9 -    window->windowed.w = window->w;
    1.10 -    window->windowed.h = window->h;
    1.11 -
    1.12      if (flags & SDL_WINDOW_MAXIMIZED) {
    1.13          SDL_MaximizeWindow(window);
    1.14      }
    1.15 @@ -1413,6 +1408,25 @@
    1.16              window->y = bounds.y + (bounds.h - h) / 2;
    1.17          }
    1.18      }
    1.19 +    window->windowed.x = window->x;
    1.20 +    window->windowed.y = window->y;
    1.21 +    window->windowed.w = window->w;
    1.22 +    window->windowed.h = window->h;
    1.23 +
    1.24 +    if (flags & SDL_WINDOW_FULLSCREEN) {
    1.25 +        SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
    1.26 +        int displayIndex;
    1.27 +        SDL_Rect bounds;
    1.28 +
    1.29 +        displayIndex = SDL_GetIndexOfDisplay(display);
    1.30 +        SDL_GetDisplayBounds(displayIndex, &bounds);
    1.31 +
    1.32 +        window->x = bounds.x;
    1.33 +        window->y = bounds.y;
    1.34 +        window->w = bounds.w;
    1.35 +        window->h = bounds.h;
    1.36 +    }
    1.37 +
    1.38      window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN);
    1.39      window->last_fullscreen_flags = window->flags;
    1.40      window->opacity = 1.0f;