mirror of https://github.com/mpv-player/mpv
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:
parent
645923f634
commit
708fb47bcb
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue