0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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.
This commit is contained in:
Stefano Pigozzi 2013-03-10 17:21:38 +01:00
parent bc20f2cb00
commit 89aae59e89

View File

@ -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)