aboutsummaryrefslogtreecommitdiffhomepage
path: root/video/out/x11_common.c
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2016-09-23 12:09:48 +0200
committerGravatar wm4 <wm4@nowhere>2016-09-23 12:09:48 +0200
commitcaa14e3d45cc816d85d7ce0167b97a5ea3fbd794 (patch)
tree0c697ccc24f99b381e433687d1b20b128bf0e93a /video/out/x11_common.c
parent3a436823555b4564775c602289d8bb682c435d90 (diff)
x11: fix external fullscreen update
On x11, you can change the fullscreen via the window manager and without mpv's involvement. In these cases, the internal fullscreen flag has to be updated. The hack used for this didn't really work properly. Change it accordingly. The important thing is that the shadow copy of the option is updated. This is still not really ideal. Fixes #3570.
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r--video/out/x11_common.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 32f5c6c723..46e68d6e71 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -977,17 +977,6 @@ 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;
@@ -1013,7 +1002,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);
+ x11->pending_vo_events |= VO_EVENT_FULLSCREEN_STATE;
if (!is_fullscreen && (x11->pos_changed_during_fs ||
x11->size_changed_during_fs))
@@ -1815,6 +1804,9 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
case VOCTRL_FULLSCREEN:
vo_x11_fullscreen(vo);
return VO_TRUE;
+ case VOCTRL_GET_FULLSCREEN:
+ *(int *)arg = x11->fs;
+ return VO_TRUE;
case VOCTRL_ONTOP:
vo_x11_setlayer(vo, opts->ontop);
return VO_TRUE;