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.
This commit is contained in:
Rudolf Polzer 2013-01-15 11:38:04 +01:00
parent 645923f634
commit 708fb47bcb
1 changed files with 7 additions and 8 deletions

View File

@ -375,16 +375,15 @@ static void set_fullscreen(struct vo *vo, int fs)
struct priv *vc = vo->priv; struct priv *vc = vo->priv;
struct MPOpts *opts = vo->opts; struct MPOpts *opts = vo->opts;
if (opts->vidmode) Uint32 fs_flags = 0;
SDL_SetWindowDisplayMode(vc->window, NULL); if (fs) {
else { if (opts->vidmode)
SDL_DisplayMode mode; fs_flags |= SDL_WINDOW_FULLSCREEN;
if (!SDL_GetCurrentDisplayMode(SDL_GetWindowDisplayIndex(vc->window), else
&mode)) fs_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
SDL_SetWindowDisplayMode(vc->window, &mode);
} }
if (SDL_SetWindowFullscreen(vc->window, fs)) { if (SDL_SetWindowFullscreen(vc->window, fs_flags)) {
mp_msg(MSGT_VO, MSGL_ERR, "[sdl] SDL_SetWindowFullscreen failed\n"); mp_msg(MSGT_VO, MSGL_ERR, "[sdl] SDL_SetWindowFullscreen failed\n");
return; return;
} }