diff options
author | Andrey Nazarov <skuller@skuller.net> | 2013-11-03 00:21:14 +0400 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2013-11-03 03:29:25 +0400 |
commit | 98888c2720e87cb7ce8cd738b9f806ee7c922d2d (patch) | |
tree | 9c47d1f8522482bf4bb5105a6ab62eda7d75268e | |
parent | 384d2bef0f97856b8674a7b4c10dcad9ecd244da (diff) |
Fix video mode and geometry update for SDL 2.
-rw-r--r-- | src/unix/sdl2/video.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/unix/sdl2/video.c b/src/unix/sdl2/video.c index 1e649f9..949b71a 100644 --- a/src/unix/sdl2/video.c +++ b/src/unix/sdl2/video.c @@ -207,6 +207,9 @@ static void VID_SDL_SetMode(void) int freq; if (vid_fullscreen->integer) { + // FIXME: force update by toggling fullscreen mode + SDL_SetWindowFullscreen(sdl_window, 0); + if (VID_GetFullscreen(&rc, &freq, NULL)) { SDL_DisplayMode mode = { .format = SDL_PIXELFORMAT_UNKNOWN, @@ -221,6 +224,10 @@ static void VID_SDL_SetMode(void) flags = SDL_WINDOW_FULLSCREEN_DESKTOP; } } else { + if (VID_GetGeometry(&rc)) { + SDL_SetWindowSize(sdl_window, rc.width, rc.height); + SDL_SetWindowPosition(sdl_window, rc.x, rc.y); + } flags = 0; } |