diff options
author | wm4 <wm4@nowhere> | 2013-07-18 14:05:39 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-18 14:07:21 +0200 |
commit | c4b08a9a1149a83d7374eaea9863dd4c7cbd12d7 (patch) | |
tree | 46dbfc1850b7166948b4447332a20edefcedc779 /core | |
parent | 05cf512dc56aab1aaf12884e44065cf2fc03c11e (diff) | |
download | mpv-c4b08a9a1149a83d7374eaea9863dd4c7cbd12d7.tar.bz2 mpv-c4b08a9a1149a83d7374eaea9863dd4c7cbd12d7.tar.xz |
video: remove fullscreen flags chaos
There was a MPOpts fullscreen field, a mp_vo_opts.fs field, and
VOFLAG_FULLSCREEN. Remove all these and introduce a
mp_vo_opts.fullscreen flag instead.
When VOs receive VOCTRL_FULLSCREEN, they are supposed to set the
current fullscreen mode to the state in mp_vo_opts.fullscreen. They
also should do this implicitly on config().
VOs which are capable of doing so can update the mp_vo_opts.fullscreen
if the actual fullscreen mode changes (e.g. if the user uses the
window manager controls). If fullscreen mode switching fails, they
can also set mp_vo_opts.fullscreen to the actual state.
Note that the X11 backend does almost none of this, and it has a
private fs flag to store the fullscreen flag, instead of getting it
from the WM. (Possibly because it has to deal with broken WMs.)
The fullscreen option has to be checked on config() to deal with
the -fs option, especially with something like:
mpv --fs file1.mkv --{ --no-fs file2.mkv --}
(It should start in fullscreen mode, but go to windowed mode when
playing file2.mkv.)
Wayland changes by: Alexander Preisinger <alexander.preisinger@gmail.com>
Cocoa changes by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/command.c | 7 | ||||
-rw-r--r-- | core/options.c | 5 | ||||
-rw-r--r-- | core/options.h | 3 |
3 files changed, 6 insertions, 9 deletions
diff --git a/core/command.c b/core/command.c index a5504438de..d57a0976e4 100644 --- a/core/command.c +++ b/core/command.c @@ -1032,12 +1032,11 @@ static int mp_property_fullscreen(m_option_t *prop, struct mp_vo_opts *opts = mpctx->video_out->opts; if (action == M_PROPERTY_SET) { - if (opts->fs == !!*(int *) arg) - return M_PROPERTY_OK; + int val = *(int *)arg; + opts->fullscreen = val; if (mpctx->video_out->config_ok) vo_control(mpctx->video_out, VOCTRL_FULLSCREEN, 0); - mpctx->opts.fullscreen = opts->fs; - return M_PROPERTY_OK; + return opts->fullscreen == val ? M_PROPERTY_OK : M_PROPERTY_ERROR; } return mp_property_generic_option(prop, action, arg, mpctx); } diff --git a/core/options.c b/core/options.c index 1eeb2e6914..694a1355a2 100644 --- a/core/options.c +++ b/core/options.c @@ -553,8 +553,8 @@ const m_option_t mp_opts[] = { OPT_FLOATRANGE("monitoraspect", vo.force_monitor_aspect, 0, 0.0, 9.0), OPT_FLOATRANGE("monitorpixelaspect", vo.monitor_pixel_aspect, 0, 0.2, 9.0), // start in fullscreen mode: - OPT_FLAG("fullscreen", fullscreen, 0), - OPT_FLAG("fs", fullscreen, 0), + OPT_FLAG("fullscreen", vo.fullscreen, 0), + OPT_FLAG("fs", vo.fullscreen, 0), // set fullscreen switch method (workaround for buggy WMs) OPT_INTRANGE("fsmode-dontuse", vo.fsmode, 0, 31, 4096), OPT_INT("colorkey", vo.colorkey, 0), @@ -731,7 +731,6 @@ const struct MPOpts mp_default_opts = { .cursor_autohide_delay = 1000, .monitor_pixel_aspect = 1.0, .panscanrange = 1.0, - .fs = false, .screen_id = -1, .fsscreen_id = -1, .nomouse_input = 0, diff --git a/core/options.h b/core/options.h index 8fe6c231b1..b1f624d930 100644 --- a/core/options.h +++ b/core/options.h @@ -11,7 +11,7 @@ typedef struct mp_vo_opts { int screenwidth; int screenheight; int ontop; - bool fs; + int fullscreen; int screen_id; int fsscreen_id; char *winname; @@ -71,7 +71,6 @@ typedef struct MPOpts { int gamma_hue; int stop_screensaver; - int fullscreen; int requested_colorspace; int requested_input_range; int requested_output_range; |