From e267ff93f32783e324c93395ab135e5b26f0efe1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 4 Sep 2014 22:53:50 +0200 Subject: video: rename VOCTRL_GET_WINDOW_SIZE Make it clear that this accesses the un-fullscreened window size. --- player/command.c | 6 ++++-- video/out/cocoa_common.m | 4 ++-- video/out/vo.h | 6 ++++-- video/out/w32_common.c | 4 ++-- video/out/wayland_common.c | 4 ++-- video/out/x11_common.c | 4 ++-- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/player/command.c b/player/command.c index 3e5849fe80..4879115d86 100644 --- a/player/command.c +++ b/player/command.c @@ -2169,13 +2169,15 @@ static int mp_property_window_scale(void *ctx, struct m_property *prop, case M_PROPERTY_SET: { double scale = *(double *)arg; int s[2] = {vid_w * scale, vid_h * scale}; - if (s[0] > 0 && s[1] > 0 && vo_control(vo, VOCTRL_SET_WINDOW_SIZE, s) > 0) + if (s[0] > 0 && s[1] > 0 && + vo_control(vo, VOCTRL_SET_UNFS_WINDOW_SIZE, s) > 0) return M_PROPERTY_OK; return M_PROPERTY_UNAVAILABLE; } case M_PROPERTY_GET: { int s[2]; - if (vo_control(vo, VOCTRL_GET_WINDOW_SIZE, s) <= 0 || s[0] < 1 || s[1] < 1) + if (vo_control(vo, VOCTRL_GET_UNFS_WINDOW_SIZE, s) <= 0 || + s[0] < 1 || s[1] < 1) return M_PROPERTY_UNAVAILABLE; double xs = (double)s[0] / vid_w; double ys = (double)s[1] / vid_h; diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index a1ea157482..dc7a195442 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -656,7 +656,7 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg) case VOCTRL_ONTOP: vo_cocoa_ontop(vo); return VO_TRUE; - case VOCTRL_GET_WINDOW_SIZE: { + case VOCTRL_GET_UNFS_WINDOW_SIZE: { int *s = arg; dispatch_on_main_thread(vo, ^{ NSSize size = [vo->cocoa->view frame].size; @@ -665,7 +665,7 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg) }); return VO_TRUE; } - case VOCTRL_SET_WINDOW_SIZE: { + case VOCTRL_SET_UNFS_WINDOW_SIZE: { dispatch_on_main_thread(vo, ^{ int *s = arg; [vo->cocoa->window queueNewVideoSize:NSMakeSize(s[0], s[1])]; diff --git a/video/out/vo.h b/video/out/vo.h index 9e70bde310..602a4cc8c4 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -72,8 +72,10 @@ enum mp_voctrl { VOCTRL_SET_DEINTERLACE, VOCTRL_GET_DEINTERLACE, - VOCTRL_GET_WINDOW_SIZE, // int[2] (w/h) - VOCTRL_SET_WINDOW_SIZE, // int[2] (w/h) + // Return or set window size (not-fullscreen mode only - if fullscreened, + // these must access the not-fullscreened window size only). + VOCTRL_GET_UNFS_WINDOW_SIZE, // int[2] (w/h) + VOCTRL_SET_UNFS_WINDOW_SIZE, // int[2] (w/h) // The VO is supposed to set "known" fields, and leave the others // untouched or set to 0. diff --git a/video/out/w32_common.c b/video/out/w32_common.c index ed23727754..df2c53128f 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -1100,7 +1100,7 @@ static int gui_thread_control(struct vo_w32_state *w32, int *events, reinit_window_state(w32); *events |= VO_EVENT_RESIZE; return VO_TRUE; - case VOCTRL_GET_WINDOW_SIZE: { + case VOCTRL_GET_UNFS_WINDOW_SIZE: { int *s = arg; if (!w32->window_bounds_initialized) @@ -1110,7 +1110,7 @@ static int gui_thread_control(struct vo_w32_state *w32, int *events, s[1] = w32->current_fs ? w32->prev_height : w32->dh; return VO_TRUE; } - case VOCTRL_SET_WINDOW_SIZE: { + case VOCTRL_SET_UNFS_WINDOW_SIZE: { int *s = arg; if (!w32->window_bounds_initialized) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 614f9fd770..842e649812 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1146,13 +1146,13 @@ int vo_wayland_control (struct vo *vo, int *events, int request, void *arg) case VOCTRL_ONTOP: vo_wayland_ontop(vo); return VO_TRUE; - case VOCTRL_GET_WINDOW_SIZE: { + case VOCTRL_GET_UNFS_WINDOW_SIZE: { int *s = arg; s[0] = wl->window.width; s[1] = wl->window.height; return VO_TRUE; } - case VOCTRL_SET_WINDOW_SIZE: { + case VOCTRL_SET_UNFS_WINDOW_SIZE: { int *s = arg; if (!wl->window.is_fullscreen) schedule_resize(wl, 0, s[0], s[1]); diff --git a/video/out/x11_common.c b/video/out/x11_common.c index ab55d6322a..46bf8c18d6 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -1547,7 +1547,7 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg) vo_x11_border(vo); *events |= VO_EVENT_RESIZE; return VO_TRUE; - case VOCTRL_GET_WINDOW_SIZE: { + case VOCTRL_GET_UNFS_WINDOW_SIZE: { int *s = arg; if (!x11->window) return VO_FALSE; @@ -1555,7 +1555,7 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg) s[1] = x11->fs ? RC_H(x11->nofsrc) : RC_H(x11->winrc); return VO_TRUE; } - case VOCTRL_SET_WINDOW_SIZE: { + case VOCTRL_SET_UNFS_WINDOW_SIZE: { int *s = arg; if (!x11->window) return VO_FALSE; -- cgit v1.2.3