From 708fb47bcb5272689cd9c333cb6df09b176c3163 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Tue, 15 Jan 2013 11:38:04 +0100 Subject: [PATCH] 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. --- video/out/vo_sdl.c | 15 +++++++-------- 1 file 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; }