Skip to content
Permalink
Browse files

Fixed creating fullscreen windows on Steam Link

  • Loading branch information
slouken committed Jan 22, 2016
1 parent e5d575b commit 67f9fd2bc427d7bee88b281eaa17a6064f9f93ba
Showing with 19 additions and 5 deletions.
  1. +19 −5 src/video/SDL_video.c
@@ -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);
}
@@ -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;

0 comments on commit 67f9fd2

Please sign in to comment.