diff options
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r-- | video/out/cocoa_common.m | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 6f7c374f6f..50b0d2889c 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -150,11 +150,11 @@ static struct vo_cocoa_state *vo_cocoa_init_state(struct vo *vo) .windowed_frame = {{0,0},{0,0}}, .out_fs_resize = NO, .display_cursor = 1, - .vo_cursor_autohide_delay = vo->opts->vo.cursor_autohide_delay, + .vo_cursor_autohide_delay = vo->opts->cursor_autohide_delay, .power_mgmt_assertion = kIOPMNullAssertionID, .accumulated_scroll = 0, }; - if (!vo->opts->vo.border) s->windowed_mask = NSBorderlessWindowMask; + if (!vo->opts->border) s->windowed_mask = NSBorderlessWindowMask; return s; } @@ -278,26 +278,26 @@ static int get_screen_handle(int identifier, NSWindow *window, NSScreen **screen static void update_screen_info(struct vo *vo) { struct vo_cocoa_state *s = vo->cocoa; - struct MPOpts *opts = vo->opts; + struct mp_vo_opts *opts = vo->opts; NSScreen *ws, *fss; - get_screen_handle(opts->vo.screen_id, s->window, &ws); + get_screen_handle(opts->screen_id, s->window, &ws); s->screen_frame = [ws frame]; - get_screen_handle(opts->vo.fsscreen_id, s->window, &fss); + get_screen_handle(opts->fsscreen_id, s->window, &fss); s->fsscreen_frame = [fss frame]; } void vo_cocoa_update_xinerama_info(struct vo *vo) { struct vo_cocoa_state *s = vo->cocoa; - struct MPOpts *opts = vo->opts; + struct mp_vo_opts *opts = vo->opts; update_screen_info(vo); aspect_save_screenres(vo, s->screen_frame.size.width, s->screen_frame.size.height); - opts->vo.screenwidth = s->screen_frame.size.width; - opts->vo.screenheight = s->screen_frame.size.height; + opts->screenwidth = s->screen_frame.size.width; + opts->screenheight = s->screen_frame.size.height; vo->xinerama_x = s->screen_frame.origin.x; vo->xinerama_y = s->screen_frame.origin.y; } @@ -338,9 +338,9 @@ static void vo_set_level(struct vo *vo, int ontop) void vo_cocoa_ontop(struct vo *vo) { - struct MPOpts *opts = vo->opts; - opts->vo.ontop = !opts->vo.ontop; - vo_set_level(vo, opts->vo.ontop); + struct mp_vo_opts *opts = vo->opts; + opts->ontop = !opts->ontop; + vo_set_level(vo, opts->ontop); } static void update_state_sizes(struct vo_cocoa_state *s, @@ -418,7 +418,7 @@ static void update_window(struct vo *vo) if (s->current_video_size.width != s->previous_video_size.width || s->current_video_size.height != s->previous_video_size.height) { - if (vo->opts->vo.fs) { + if (vo->opts->fs) { // we will resize as soon as we get out of fullscreen s->out_fs_resize = YES; } else { @@ -436,7 +436,7 @@ 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; + struct mp_vo_opts *opts = vo->opts; if (vo->config_count > 0) { NSPoint origin = [s->window frame].origin; @@ -463,7 +463,7 @@ int vo_cocoa_config_window(struct vo *vo, uint32_t d_width, if (flags & VOFLAG_FULLSCREEN) vo_cocoa_fullscreen(vo); - vo_set_level(vo, opts->vo.ontop); + vo_set_level(vo, opts->ontop); [s->window setContentSize:s->current_video_size]; [s->window setContentAspectRatio:s->current_video_size]; @@ -491,7 +491,7 @@ static void vo_cocoa_display_cursor(struct vo *vo, int requested_state) { struct vo_cocoa_state *s = vo->cocoa; if (requested_state) { - if (!vo->opts->vo.fs || s->vo_cursor_autohide_delay > -2) { + if (!vo->opts->fs || s->vo_cursor_autohide_delay > -2) { s->display_cursor = requested_state; CGDisplayShowCursor(kCGDirectMainDisplay); } @@ -510,7 +510,7 @@ int vo_cocoa_check_events(struct vo *vo) int ms_time = (int) ([[NSProcessInfo processInfo] systemUptime] * 1000); // automatically hide mouse cursor - if (vo->opts->vo.fs && s->display_cursor && + if (vo->opts->fs && s->display_cursor && (ms_time - s->cursor_timer >= s->vo_cursor_autohide_delay)) { vo_cocoa_display_cursor(vo, 0); s->cursor_timer = ms_time; @@ -648,8 +648,8 @@ void create_menu() - (void)fullscreen { struct vo_cocoa_state *s = _vo->cocoa; - struct MPOpts *opts = _vo->opts; - if (!opts->vo.fs) { + struct mp_vo_opts *opts = _vo->opts; + if (!opts->fs) { update_screen_info(_vo); if (current_screen_has_dock_or_menubar(_vo)) [NSApp setPresentationOptions:NSApplicationPresentationHideDock| @@ -658,7 +658,7 @@ void create_menu() [self setHasShadow:NO]; [self setStyleMask:s->fullscreen_mask]; [self setFrame:s->fsscreen_frame display:YES animate:NO]; - opts->vo.fs = true; + opts->fs = true; vo_cocoa_display_cursor(_vo, 0); [self setMovableByWindowBackground: NO]; } else { @@ -672,7 +672,7 @@ void create_menu() s->out_fs_resize = NO; } [self setContentAspectRatio:s->current_video_size]; - opts->vo.fs = false; + opts->fs = false; vo_cocoa_display_cursor(_vo, 1); [self setMovableByWindowBackground: YES]; } @@ -697,7 +697,7 @@ void create_menu() // this is only valid as a starting value. it will be rewritten in the // -fullscreen method. if (_vo) { - return !_vo->opts->vo.fs; + return !_vo->opts->fs; } else { return NO; } @@ -735,7 +735,7 @@ void create_menu() - (void)mouseMoved: (NSEvent *) theEvent { - if (_vo->opts->vo.fs) + if (_vo->opts->fs) vo_cocoa_display_cursor(_vo, 1); } @@ -856,7 +856,7 @@ void create_menu() - (void)applicationWillBecomeActive:(NSNotification *)aNotification { - if (_vo->opts->vo.fs && current_screen_has_dock_or_menubar(_vo)) { + if (_vo->opts->fs && current_screen_has_dock_or_menubar(_vo)) { struct vo_cocoa_state *s = _vo->cocoa; [self setLevel:s->window_level]; [NSApp setPresentationOptions:NSApplicationPresentationHideDock| @@ -866,7 +866,7 @@ void create_menu() - (void)applicationWillResignActive:(NSNotification *)aNotification { - if (_vo->opts->vo.fs) { + if (_vo->opts->fs) { [self setLevel:NSNormalWindowLevel]; [NSApp setPresentationOptions:NSApplicationPresentationDefault]; } @@ -893,7 +893,7 @@ void create_menu() - (void)mulSize:(float)multiplier { - if (!_vo->opts->vo.fs) { + if (!_vo->opts->fs) { NSSize size = { .width = _vo->aspdat.prew * multiplier, .height = _vo->aspdat.preh * multiplier |