diff options
author | Rudolf Polzer <divverent@xonotic.org> | 2013-01-15 11:38:04 +0100 |
---|---|---|
committer | Rudolf Polzer <divverent@xonotic.org> | 2013-01-15 11:38:04 +0100 |
commit | 708fb47bcb5272689cd9c333cb6df09b176c3163 (patch) | |
tree | aae612c3711341eedfcf3cfae3317759957f62f6 /video/out/vo_sdl.c | |
parent | 645923f634de43d95fbfa1c37855e4c37d5682a7 (diff) | |
download | mpv-708fb47bcb5272689cd9c333cb6df09b176c3163.tar.bz2 mpv-708fb47bcb5272689cd9c333cb6df09b176c3163.tar.xz |
vo_sdl: request "desktop" fullscreen mode if -vm is not used
This is a lot cleaner than our current workaround that first queries the
desktop resolution.
Diffstat (limited to 'video/out/vo_sdl.c')
-rw-r--r-- | video/out/vo_sdl.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c index b4d88eb341..af75f46ef4 100644 --- a/video/out/vo_sdl.c +++ b/video/out/vo_sdl.c @@ -375,16 +375,15 @@ static void set_fullscreen(struct vo *vo, int fs) struct priv *vc = vo->priv; struct MPOpts *opts = vo->opts; - if (opts->vidmode) - SDL_SetWindowDisplayMode(vc->window, NULL); - else { - SDL_DisplayMode mode; - if (!SDL_GetCurrentDisplayMode(SDL_GetWindowDisplayIndex(vc->window), - &mode)) - SDL_SetWindowDisplayMode(vc->window, &mode); + Uint32 fs_flags = 0; + if (fs) { + if (opts->vidmode) + fs_flags |= SDL_WINDOW_FULLSCREEN; + else + fs_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; } - if (SDL_SetWindowFullscreen(vc->window, fs)) { + if (SDL_SetWindowFullscreen(vc->window, fs_flags)) { mp_msg(MSGT_VO, MSGL_ERR, "[sdl] SDL_SetWindowFullscreen failed\n"); return; } |