diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-03-03 21:29:32 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-03-03 21:52:58 +0100 |
commit | 8fc0b618d501f631c80b11c600a89b597e4fe08b (patch) | |
tree | 4ff0f5569ee993cb528f9b8083802be34bc0094d /video/out/cocoa_common.m | |
parent | 979ce46c6403e70bc90348aba260c825e5189b2c (diff) | |
download | mpv-8fc0b618d501f631c80b11c600a89b597e4fe08b.tar.bz2 mpv-8fc0b618d501f631c80b11c600a89b597e4fe08b.tar.xz |
cocoa_common: make windows appear again
Commit 9efe32120 stops recreating the hidden window used for OpenGL's
extensions autodetection. The `cocoa_common` code assumed the hidden flag could
only come when creating a window which is now not true anymore.
Move some code around so that hidden, fullscreen and window position are
respected on subsequent calls of config.
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r-- | video/out/cocoa_common.m | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 67b16772d0..add42de953 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -355,8 +355,6 @@ static int create_window(struct vo *vo, uint32_t d_width, uint32_t d_height, uint32_t flags, int gl3profile) { struct vo_cocoa_state *s = vo->cocoa; - struct MPOpts *opts = vo->opts; - const NSRect window_rect = NSMakeRect(xinerama_x, xinerama_y, d_width, d_height); const NSRect glview_rect = NSMakeRect(0, 0, 100, 100); @@ -410,21 +408,6 @@ static int create_window(struct vo *vo, uint32_t d_width, uint32_t d_height, [NSApp setDelegate:s->window]; [s->window setDelegate:s->window]; - [s->window setContentSize:s->current_video_size]; - [s->window setContentAspectRatio:s->current_video_size]; - [s->window setFrameOrigin:NSMakePoint(vo->dx, vo->dy)]; - - if (flags & VOFLAG_HIDDEN) { - [s->window orderOut:nil]; - } else { - [s->window makeKeyAndOrderFront:nil]; - [NSApp activateIgnoringOtherApps:YES]; - } - - if (flags & VOFLAG_FULLSCREEN) - vo_cocoa_fullscreen(vo); - - vo_set_level(vo, opts->vo_ontop); return 0; } @@ -453,6 +436,13 @@ int vo_cocoa_config_window(struct vo *vo, uint32_t d_width, int gl3profile) { struct vo_cocoa_state *s = vo->cocoa; + struct MPOpts *opts = vo->opts; + + if (vo->config_count > 0) { + NSPoint origin = [s->window frame].origin; + vo->dx = origin.x; + vo->dy = origin.y; + } update_state_sizes(s, d_width, d_height); @@ -463,6 +453,22 @@ int vo_cocoa_config_window(struct vo *vo, uint32_t d_width, update_window(vo); } + if (flags & VOFLAG_HIDDEN) { + [s->window orderOut:nil]; + } else { + [s->window makeKeyAndOrderFront:nil]; + [NSApp activateIgnoringOtherApps:YES]; + } + + if (flags & VOFLAG_FULLSCREEN) + vo_cocoa_fullscreen(vo); + + vo_set_level(vo, opts->vo_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) |