diff options
-rw-r--r-- | player/command.c | 15 | ||||
-rw-r--r-- | video/out/cocoa_common.m | 2 | ||||
-rw-r--r-- | video/out/vo_rpi.c | 1 | ||||
-rw-r--r-- | video/out/vo_sdl.c | 1 | ||||
-rw-r--r-- | video/out/wayland_common.c | 4 | ||||
-rw-r--r-- | video/out/x11_common.c | 4 |
6 files changed, 7 insertions, 20 deletions
diff --git a/player/command.c b/player/command.c index a59fa059b8..7a6820af3e 100644 --- a/player/command.c +++ b/player/command.c @@ -2352,18 +2352,13 @@ static int panscan_property_helper(void *ctx, struct m_property *prop, static int mp_property_vo_flag(struct m_property *prop, int action, void *arg, int vo_ctrl, int *vo_var, MPContext *mpctx) { - if (action == M_PROPERTY_SET) { - int desired = !!*(int *) arg; - if (*vo_var == desired) - return M_PROPERTY_OK; - if (mpctx->video_out) { + int old = *vo_var; + int res = mp_property_generic_option(mpctx, prop, action, arg); + if (action == M_PROPERTY_SET && old != *vo_var) { + if (mpctx->video_out) vo_control(mpctx->video_out, vo_ctrl, 0); - } else { - *vo_var = desired; - } - return *vo_var == desired ? M_PROPERTY_OK : M_PROPERTY_ERROR; } - return mp_property_generic_option(mpctx, prop, action, arg); + return res; } /// Fullscreen state (RW) diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 557e28e4f1..7cb30cc49d 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -449,7 +449,6 @@ static int vo_cocoa_ontop(struct vo *vo) return VO_NOTIMPL; struct mp_vo_opts *opts = vo->opts; - opts->ontop = !opts->ontop; vo_set_level(vo, opts->ontop); return VO_TRUE; } @@ -793,7 +792,6 @@ static int vo_cocoa_control_on_main_thread(struct vo *vo, int request, void *arg switch (request) { case VOCTRL_FULLSCREEN: - opts->fullscreen = !opts->fullscreen; return vo_cocoa_fullscreen(vo); case VOCTRL_ONTOP: return vo_cocoa_ontop(vo); diff --git a/video/out/vo_rpi.c b/video/out/vo_rpi.c index 947e63037e..cbbd781f0b 100644 --- a/video/out/vo_rpi.c +++ b/video/out/vo_rpi.c @@ -612,7 +612,6 @@ static int control(struct vo *vo, uint32_t request, void *data) switch (request) { case VOCTRL_FULLSCREEN: - vo->opts->fullscreen = !vo->opts->fullscreen; if (p->renderer_enabled) set_geometry(vo); vo->want_redraw = true; diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c index d33ace147a..cf509acae5 100644 --- a/video/out/vo_sdl.c +++ b/video/out/vo_sdl.c @@ -975,7 +975,6 @@ static int control(struct vo *vo, uint32_t request, void *data) switch (request) { case VOCTRL_FULLSCREEN: - vo->opts->fullscreen = !vo->opts->fullscreen; set_fullscreen(vo); return 1; case VOCTRL_REDRAW_FRAME: diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index e42af8438e..480f29638b 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -957,8 +957,9 @@ void vo_wayland_uninit(struct vo *vo) static void vo_wayland_ontop(struct vo *vo) { struct vo_wayland_state *wl = vo->wayland; + if (!vo->opts->ontop) + return; MP_DBG(wl, "going ontop\n"); - vo->opts->ontop = 1; window_set_toplevel(wl); schedule_resize(wl, 0, wl->window.width, wl->window.height); } @@ -1046,7 +1047,6 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg) wl->window.events = 0; return VO_TRUE; case VOCTRL_FULLSCREEN: - vo->opts->fullscreen = !vo->opts->fullscreen; vo_wayland_fullscreen(vo); return VO_TRUE; case VOCTRL_ONTOP: diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 8c51329a13..868d0a1463 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -1801,19 +1801,15 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg) x11->pending_vo_events = 0; return VO_TRUE; case VOCTRL_FULLSCREEN: - opts->fullscreen = !opts->fullscreen; vo_x11_fullscreen(vo); return VO_TRUE; case VOCTRL_ONTOP: - opts->ontop = !opts->ontop; vo_x11_setlayer(vo, opts->ontop); return VO_TRUE; case VOCTRL_BORDER: - opts->border = !opts->border; vo_x11_decoration(vo, vo->opts->border); return VO_TRUE; case VOCTRL_ALL_WORKSPACES: { - opts->all_workspaces = !opts->all_workspaces; long params[5] = {0xFFFFFFFF, 1}; if (!opts->all_workspaces) { x11_get_property_copy(x11, x11->rootwin, XA(x11, _NET_CURRENT_DESKTOP), |