summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-31 20:19:40 +0100
committerwm4 <wm4@nowhere>2013-10-31 23:30:14 +0100
commit94542abf2e2ccb123cf3b0c9eef76a2290dd19b1 (patch)
tree309891190830d57508df39228bd9f230a65c50cf /video
parentb55d55782274d13eec434702c8f11cfb37a49230 (diff)
downloadmpv-94542abf2e2ccb123cf3b0c9eef76a2290dd19b1.tar.bz2
mpv-94542abf2e2ccb123cf3b0c9eef76a2290dd19b1.tar.xz
command: add property to scale window size
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.h2
-rw-r--r--video/out/x11_common.c13
2 files changed, 15 insertions, 0 deletions
diff --git a/video/out/vo.h b/video/out/vo.h
index 1777245c96..d9058b96e9 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -71,6 +71,8 @@ enum mp_voctrl {
VOCTRL_UPDATE_SCREENINFO,
VOCTRL_WINDOW_TO_OSD_COORDS, // float[2] (x/y)
+ VOCTRL_GET_WINDOW_SIZE, // int[2] (w/h)
+ VOCTRL_SET_WINDOW_SIZE, // int[2] (w/h)
VOCTRL_SET_YUV_COLORSPACE, // struct mp_csp_details*
VOCTRL_GET_YUV_COLORSPACE, // struct mp_csp_details*
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 185350591f..fff74c3b2c 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1486,6 +1486,19 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
case VOCTRL_UPDATE_SCREENINFO:
vo_x11_update_screeninfo(vo);
return VO_TRUE;
+ case VOCTRL_GET_WINDOW_SIZE: {
+ int *s = arg;
+ if (!x11->window)
+ return VO_FALSE;
+ s[0] = x11->win_width;
+ s[1] = x11->win_height;
+ return VO_TRUE;
+ }
+ case VOCTRL_SET_WINDOW_SIZE: {
+ int *s = arg;
+ vo_x11_highlevel_resize(vo, x11->win_x, x11->win_y, s[0], s[1]);
+ return VO_TRUE;
+ }
case VOCTRL_SET_CURSOR_VISIBILITY:
vo_set_cursor_hidden(vo, !(*(bool *)arg));
return VO_TRUE;