Skip to content

Commit

Permalink
Fixed creating fullscreen windows on Steam Link
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 22, 2016
1 parent e5d575b commit 67f9fd2
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/video/SDL_video.c
Expand Up @@ -1309,11 +1309,6 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen)
static void
SDL_FinishWindowCreation(SDL_Window *window, Uint32 flags)
{
window->windowed.x = window->x;
window->windowed.y = window->y;
window->windowed.w = window->w;
window->windowed.h = window->h;

if (flags & SDL_WINDOW_MAXIMIZED) {
SDL_MaximizeWindow(window);
}
Expand Down Expand Up @@ -1413,6 +1408,25 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
window->y = bounds.y + (bounds.h - h) / 2;
}
}
window->windowed.x = window->x;
window->windowed.y = window->y;
window->windowed.w = window->w;
window->windowed.h = window->h;

if (flags & SDL_WINDOW_FULLSCREEN) {
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
int displayIndex;
SDL_Rect bounds;

displayIndex = SDL_GetIndexOfDisplay(display);
SDL_GetDisplayBounds(displayIndex, &bounds);

window->x = bounds.x;
window->y = bounds.y;
window->w = bounds.w;
window->h = bounds.h;
}

window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN);
window->last_fullscreen_flags = window->flags;
window->opacity = 1.0f;
Expand Down

0 comments on commit 67f9fd2

Please sign in to comment.