From 89aae59e896b506292e7593044321713038e43c6 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 10 Mar 2013 17:21:38 +0100 Subject: cocoa_common: fix window position when bigger than display Fix a regression introduced in commit 979ce46c64 causing a window to take up more space than what the display allows. Add keepCentered:YES, so that the video area is always clipped to the current visible frame (even when using scale). Fixes #38. --- video/out/cocoa_common.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 50b0d2889c..f8e601ffee 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -453,6 +453,10 @@ int vo_cocoa_config_window(struct vo *vo, uint32_t d_width, update_window(vo); } + [s->window setContentSize:s->current_video_size keepCentered:YES]; + [s->window setContentAspectRatio:s->current_video_size]; + [s->window setFrameOrigin:NSMakePoint(vo->dx, vo->dy)]; + if (flags & VOFLAG_HIDDEN) { [s->window orderOut:nil]; } else { @@ -465,10 +469,6 @@ int vo_cocoa_config_window(struct vo *vo, uint32_t d_width, vo_set_level(vo, opts->ontop); - [s->window setContentSize:s->current_video_size]; - [s->window setContentAspectRatio:s->current_video_size]; - [s->window setFrameOrigin:NSMakePoint(vo->dx, vo->dy)]; - resize_window(vo); if (s->window_title) -- cgit v1.2.3