Commit 31fd358e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vout: pass only a boolean to VOUT_DISPLAY_CHANGE_FULLSCREEN control

parent 83ea9ab5
......@@ -143,7 +143,7 @@ enum {
/* Ask the module to acknowledge/refuse the fullscreen state change after
* being requested (externally or by VOUT_DISPLAY_EVENT_FULLSCREEN */
VOUT_DISPLAY_CHANGE_FULLSCREEN, /* const vout_display_cfg_t *p_cfg */
VOUT_DISPLAY_CHANGE_FULLSCREEN, /* bool fs */
/* Ask the module to acknowledge/refuse the window management state change
* after being requested externally or by VOUT_DISPLAY_WINDOW_STATE */
......
......@@ -300,7 +300,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
case VOUT_DISPLAY_CHANGE_ZOOM:
case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
case VOUT_DISPLAY_CHANGE_FULLSCREEN:
{
const vout_display_cfg_t *cfg;
const video_format_t *source;
......@@ -343,6 +342,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
assert (0);
default:
msg_Err (vd, "Unhandled request %d", query);
case VOUT_DISPLAY_CHANGE_FULLSCREEN:
return VLC_EGENERIC;
}
......
......@@ -265,7 +265,6 @@ static int Control(vout_display_t *vd, int query, va_list ap)
case VOUT_DISPLAY_HIDE_MOUSE:
return VLC_EGENERIC;
case VOUT_DISPLAY_CHANGE_FULLSCREEN:
case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
case VOUT_DISPLAY_CHANGE_ZOOM:
case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
......@@ -320,6 +319,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
assert (0);
default:
msg_Err(vd, "Unknown request %d", query);
case VOUT_DISPLAY_CHANGE_FULLSCREEN:
return VLC_EGENERIC;
}
}
......
......@@ -442,10 +442,9 @@ static int Control( vout_display_t *vd, int query, va_list args )
case VOUT_DISPLAY_CHANGE_FULLSCREEN:
{
const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);
bool fs = va_arg(args, int);
WinPostMsg( sys->client, WM_VLC_FULLSCREEN_CHANGE,
MPFROMLONG( cfg->is_fullscreen ), 0 );
WinPostMsg( sys->client, WM_VLC_FULLSCREEN_CHANGE, MPFROMLONG(fs), 0 );
return VLC_SUCCESS;
}
......
......@@ -607,9 +607,9 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
sys->is_on_top = is_on_top;
return VLC_SUCCESS;
}
case VOUT_DISPLAY_CHANGE_FULLSCREEN: { /* const vout_display_cfg_t *p_cfg */
const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);
if (CommonControlSetFullscreen(vd, cfg->is_fullscreen))
case VOUT_DISPLAY_CHANGE_FULLSCREEN: {
bool fs = va_arg(args, int);
if (CommonControlSetFullscreen(vd, fs))
return VLC_EGENERIC;
UpdateRects(vd, NULL, NULL, false);
return VLC_SUCCESS;
......
......@@ -494,24 +494,17 @@ static int Control(vout_display_t *vd, int query, va_list args)
return VLC_SUCCESS;
}
case VOUT_DISPLAY_CHANGE_FULLSCREEN: {
vout_display_cfg_t cfg = *va_arg(args, const vout_display_cfg_t *);
bool fs = va_arg(args, int);
/* Fix flags */
sys->display_flags &= ~(SDL_FULLSCREEN | SDL_RESIZABLE);
sys->display_flags |= cfg.is_fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE;
sys->display_flags |= fs ? SDL_FULLSCREEN : SDL_RESIZABLE;
if (cfg.is_fullscreen) {
cfg.display.width = sys->desktop_width;
cfg.display.height = sys->desktop_height;
}
if (sys->overlay) {
sys->display = SDL_SetVideoMode(cfg.display.width, cfg.display.height,
if (sys->overlay)
sys->display = SDL_SetVideoMode(sys->desktop_width, sys->desktop_height,
sys->display_bpp, sys->display_flags);
vout_display_PlacePicture(&sys->place, &vd->source, &cfg, !sys->overlay);
}
vout_display_SendEventDisplaySize(vd, cfg.display.width, cfg.display.height);
vout_display_SendEventDisplaySize(vd, sys->desktop_width, sys->desktop_height);
return VLC_SUCCESS;
}
case VOUT_DISPLAY_CHANGE_ZOOM:
......
......@@ -858,13 +858,8 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
/* */
if (ch_fullscreen) {
vout_display_cfg_t cfg = osys->cfg;
cfg.is_fullscreen = is_fullscreen;
cfg.display.width = cfg.is_fullscreen ? 0 : osys->width_saved;
cfg.display.height = cfg.is_fullscreen ? 0 : osys->height_saved;
if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_FULLSCREEN, &cfg) == VLC_SUCCESS) {
if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_FULLSCREEN,
is_fullscreen) == VLC_SUCCESS) {
osys->cfg.is_fullscreen = is_fullscreen;
if (!is_fullscreen)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment