diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2012-11-10 20:19:21 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2012-11-10 22:37:19 +0100 |
commit | c78243c03e25aa62171e7353ed455d1ac6ea77b0 (patch) | |
tree | d50c6d3475da2526fc93bfb38ab3e923103cbcf3 | |
parent | 05650110f3e3f6ff8bdbc3d982cfefe5674e60d3 (diff) | |
download | mpv-c78243c03e25aa62171e7353ed455d1ac6ea77b0.tar.bz2 mpv-c78243c03e25aa62171e7353ed455d1ac6ea77b0.tar.xz |
cocoa_common: honor the `--geometry` option
-rw-r--r-- | DOCS/man/en/options.rst | 4 | ||||
-rw-r--r-- | libvo/cocoa_common.m | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index 56d8305c95..e4fbca3af8 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -704,6 +704,10 @@ *NOTE*: May not be supported by some of the older VO drivers. + *NOTE (OSX)*: On Mac OSX the origin of the screen coordinate system is + located on the the bottom-left corner. For instance, ``0:0`` will place the + window at the bottom-left of the screen. + *EXAMPLE*: ``50:40`` diff --git a/libvo/cocoa_common.m b/libvo/cocoa_common.m index 39d5d74b92..337e0a32be 100644 --- a/libvo/cocoa_common.m +++ b/libvo/cocoa_common.m @@ -256,9 +256,15 @@ static void update_screen_info(struct vo *vo) void vo_cocoa_update_xinerama_info(struct vo *vo) { struct vo_cocoa_state *s = vo->cocoa; + struct MPOpts *opts = vo->opts; + update_screen_info(vo); aspect_save_screenres(vo, s->screen_frame.size.width, s->screen_frame.size.height); + opts->vo_screenwidth = s->screen_frame.size.width; + opts->vo_screenheight = s->screen_frame.size.height; + xinerama_x = s->screen_frame.origin.x; + xinerama_y = s->screen_frame.origin.y; } int vo_cocoa_change_attributes(struct vo *vo) @@ -376,7 +382,7 @@ static int create_window(struct vo *vo, uint32_t d_width, uint32_t d_height, [s->window setDelegate:s->window]; [s->window setContentSize:s->current_video_size]; [s->window setContentAspectRatio:s->current_video_size]; - [s->window center]; + [s->window setFrameOrigin:NSMakePoint(vo->dx, vo->dy)]; if (flags & VOFLAG_HIDDEN) { [s->window orderOut:nil]; |