Commit 119bbdb0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

window: separate fullscreen set/unset control helpers

parent 954d2d2c
......@@ -274,18 +274,24 @@ static inline int vout_window_SetSize(vout_window_t *window,
/**
* Requests fullscreen mode.
*
* \param full true to request full screen, false to request window mode
*
* \retval VLC_SUCCESS The request has been queued to the windowing system
* (that does <b>not</b> imply that the request is complete nor succesful).
* \retval VLC_EGENERIC The request could not be queued, e.g. the back-end does
* not implement toggling between fullscreen and windowed modes.
*/
static inline int vout_window_SetFullScreen(vout_window_t *window, bool full)
static inline int vout_window_SetFullScreen(vout_window_t *window)
{
return vout_window_Control(window, VOUT_WINDOW_SET_FULLSCREEN);
}
/**
* Requests windowed mode.
*
* \return \see vout_window_SetFullScreen()
*/
static inline int vout_window_UnsetFullScreen(vout_window_t *window)
{
return vout_window_Control(window,
full ? VOUT_WINDOW_SET_FULLSCREEN
: VOUT_WINDOW_UNSET_FULLSCREEN);
return vout_window_Control(window, VOUT_WINDOW_UNSET_FULLSCREEN);
}
/**
......
......@@ -76,7 +76,8 @@ int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
p_wnd->type = VOUT_WINDOW_TYPE_NSOBJECT;
p_wnd->control = WindowControl;
}
vout_window_SetFullScreen(p_wnd, cfg->is_fullscreen);
if (cfg->is_fullscreen)
vout_window_SetFullScreen(p_wnd);
return VLC_SUCCESS;
}
......
......@@ -122,7 +122,8 @@ int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
p_wnd->control = WindowControl;
}
vout_window_SetFullScreen(p_wnd, cfg->is_fullscreen);
if (cfg->is_fullscreen)
vout_window_SetFullScreen(p_wnd);
return VLC_SUCCESS;
}
......
......@@ -400,7 +400,8 @@ static int WindowOpen( vout_window_t *pWnd, const vout_window_cfg_t *cfg )
return VLC_EGENERIC;
}
vout_window_SetFullScreen( pWnd, cfg->is_fullscreen );
if (cfg->is_fullscreen)
vout_window_SetFullScreen( pWnd );
return VLC_SUCCESS;
}
......
......@@ -296,7 +296,8 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg)
goto error;
vout_window_ReportSize(wnd, cfg->width, cfg->height);
vout_window_SetFullScreen(wnd, cfg->is_fullscreen);
if (cfg->is_fullscreen)
vout_window_SetFullScreen(wnd);
return VLC_SUCCESS;
error:
......
......@@ -378,7 +378,8 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg)
wnd->display.wl = display;
wnd->control = Control;
vout_window_SetFullScreen(wnd, cfg->is_fullscreen);
if (cfg->is_fullscreen)
vout_window_SetFullScreen(wnd);
if (vlc_clone(&sys->thread, Thread, wnd, VLC_THREAD_PRIORITY_LOW))
goto error;
......
......@@ -1345,7 +1345,8 @@ static void ThreadChangeFullscreen(vout_thread_t *vout, bool fullscreen)
if (window == NULL)
return; /* splitter! */
vout_window_SetFullScreen(window, fullscreen);
(fullscreen ? vout_window_SetFullScreen
: vout_window_UnsetFullScreen)(window);
}
static void ThreadChangeWindowState(vout_thread_t *vout, unsigned state)
......
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