diff options
author | wm4 <wm4@nowhere> | 2016-09-02 15:50:54 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-02 15:50:54 +0200 |
commit | 2c917219cffc74fcc64f04113fe260f2b88d5841 (patch) | |
tree | ae874a7185fa23e162219c6d9b27fb656f7d7c9f /video/out/x11_common.c | |
parent | 423e53ba0bad034685e5229720d55548afb1efbe (diff) | |
download | mpv-2c917219cffc74fcc64f04113fe260f2b88d5841.tar.bz2 mpv-2c917219cffc74fcc64f04113fe260f2b88d5841.tar.xz |
vo: use new option update mechanism
This is still rather basic.
run_reconfig() and run_control() update the options because it's needed
for panscan (and other video scaling options), and fullscreen, border,
ontop updates. In the old model, these options could be accessed only
while both playback thread and VO threads were locked (i.e. during
synchronous calls like vo_control()), so this should be sufficient in
order not to miss any updates. In the future, a more fine-grained update
mechanism could be added to handle these updates "exactly".
x11_common.c contains an evil hack, as I see no reasonable way to handle
this properly. The VO thread can't "lock" the main thread, so this is
not simple.
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r-- | video/out/x11_common.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 868d0a1463..aa2185315e 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -26,6 +26,7 @@ #include "config.h" #include "misc/bstr.h" #include "options/options.h" +#include "options/m_config.h" #include "common/common.h" #include "common/msg.h" #include "input/input.h" @@ -977,6 +978,17 @@ static void vo_x11_update_composition_hint(struct vo *vo) XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&hint, 1); } +// Maximally awful hack to get MPOpts.vo.fullscreen set. The awful part is that +// this sets a variable which is accessed by command.c without synchronization +// (and which isn't supposed to need any). The need for this is that there's no +// way to update this flag in any other way at all. +static void set_global_fs_flag(struct vo *vo, int fs) +{ + struct m_config *rootconfig = mp_get_root_config(vo->global); + struct MPOpts *opts = rootconfig->optstruct; + opts->vo->fullscreen = fs; +} + static void vo_x11_check_net_wm_state_fullscreen_change(struct vo *vo) { struct vo_x11_state *x11 = vo->x11; @@ -1002,6 +1014,7 @@ static void vo_x11_check_net_wm_state_fullscreen_change(struct vo *vo) { vo->opts->fullscreen = is_fullscreen; x11->fs = is_fullscreen; + set_global_fs_flag(vo, is_fullscreen); if (!is_fullscreen && (x11->pos_changed_during_fs || x11->size_changed_during_fs)) |