mirror of https://github.com/mpv-player/mpv
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:
parent
bc20f2cb00
commit
89aae59e89
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue