summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-03-10 17:21:38 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-03-10 17:27:43 +0100
commit89aae59e896b506292e7593044321713038e43c6 (patch)
tree5d24622dc53b7de76819f0b9ad58ab7814cfe0fc
parentbc20f2cb00234ce436be2f939cb62dbbde5e8dd2 (diff)
downloadmpv-89aae59e896b506292e7593044321713038e43c6.tar.bz2
mpv-89aae59e896b506292e7593044321713038e43c6.tar.xz
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.
-rw-r--r--video/out/cocoa_common.m8
1 files 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)