diff options
author | Martin Herkt <lachs0r@srsfckn.biz> | 2016-11-20 18:15:08 +0100 |
---|---|---|
committer | Martin Herkt <lachs0r@srsfckn.biz> | 2016-11-20 18:15:08 +0100 |
commit | 8700700de8a4103724796077034f7f254ad974bc (patch) | |
tree | 2fce4dee518a202c45c3f16567db36edc92ed914 /video/out/cocoa_common.m | |
parent | e6b85c91700bee0ddc92e98a30d5021691bd6f65 (diff) | |
parent | eafc273d2c2ae6d247d741202e58ca23dc938cb2 (diff) | |
download | mpv-8700700de8a4103724796077034f7f254ad974bc.tar.bz2 mpv-8700700de8a4103724796077034f7f254ad974bc.tar.xz |
Merge branch 'master' into release/current
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r-- | video/out/cocoa_common.m | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index ba241f42cc..719169df48 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -121,9 +121,14 @@ static void run_on_main_thread(struct vo *vo, void(^block)(void)) static void queue_new_video_size(struct vo *vo, int w, int h) { struct vo_cocoa_state *s = vo->cocoa; + struct mp_vo_opts *opts = vo->opts; if ([s->window conformsToProtocol: @protocol(MpvSizing)]) { id<MpvSizing> win = (id<MpvSizing>) s->window; - [win queueNewVideoSize:NSMakeSize(w, h)]; + NSRect r = NSMakeRect(0, 0, w, h); + if(!opts->hidpi_window_scale) { + r = [s->current_screen convertRectFromBacking:r]; + } + [win queueNewVideoSize:NSMakeSize(r.size.width, r.size.height)]; } } @@ -488,8 +493,10 @@ static void create_ui(struct vo *vo, struct mp_rect *win, int geo_flags) if (s->embedded) { parent = (NSView *) (intptr_t) opts->WinID; } else { - const NSRect wr = + NSRect wr = NSMakeRect(win->x0, win->y0, win->x1 - win->x0, win->y1 - win->y0); + if(!opts->hidpi_window_scale) + wr = [s->current_screen convertRectFromBacking:wr]; s->window = create_window(wr, s->current_screen, opts->border, adapter); parent = [s->window contentView]; } |