From 4ce808cc2c648d3358ed0088ac3b0311c5ff37d5 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 13 May 2013 23:05:20 +0200 Subject: cocoa_common: fix a bug in window dragging state When going in and going out of full screen the player lost information on the movableByWindowBackground behaviour. There were some hacks in place to fix it but they were broken with the recent native fullscreen changes in 74c15ec6. This commit removes the problem at the root and removes the hacks. The delegate method `isMovableByWindowBackground` seems to be called after setFrame and setPresentationOptions so change fs state in opts before that. Fixes #83 --- video/out/cocoa_common.m | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'video') diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 90a9508106..4a6cfb6a93 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -698,14 +698,19 @@ int vo_cocoa_cgl_color_size(struct vo *vo) if (opts->native_fs) { if (!opts->fs) { + opts->fs = VO_TRUE; [self setContentResizeIncrements:NSMakeSize(1, 1)]; + vo_cocoa_display_cursor(self.videoOutput, 0); } else { + opts->fs = VO_FALSE; [self setContentAspectRatio:s->current_video_size]; + vo_cocoa_display_cursor(self.videoOutput, 1); } [self toggleFullScreen:nil]; } else { if (!opts->fs) { + opts->fs = VO_TRUE; update_screen_info(self.videoOutput); if (current_screen_has_dock_or_menubar(self.videoOutput)) [NSApp setPresentationOptions:NSApplicationPresentationHideDock| @@ -714,8 +719,9 @@ int vo_cocoa_cgl_color_size(struct vo *vo) [self setHasShadow:NO]; [self setStyleMask:s->fullscreen_mask]; [self setFrame:s->fsscreen_frame display:YES animate:NO]; - [self setMovableByWindowBackground: NO]; + vo_cocoa_display_cursor(self.videoOutput, 0); } else { + opts->fs = VO_FALSE; [NSApp setPresentationOptions:NSApplicationPresentationDefault]; [self setHasShadow:YES]; [self setStyleMask:s->windowed_mask]; @@ -726,18 +732,10 @@ int vo_cocoa_cgl_color_size(struct vo *vo) s->out_fs_resize = NO; } [self setContentAspectRatio:s->current_video_size]; - [self setMovableByWindowBackground: YES]; + vo_cocoa_display_cursor(self.videoOutput, 1); } } - if (!opts->fs) { - opts->fs = VO_TRUE; - vo_cocoa_display_cursor(self.videoOutput, 0); - } else { - opts->fs = false; - vo_cocoa_display_cursor(self.videoOutput, 1); - } - resize_window(self.videoOutput); } @@ -758,12 +756,10 @@ int vo_cocoa_cgl_color_size(struct vo *vo) - (BOOL)isMovableByWindowBackground { - // this is only valid as a starting value. it will be rewritten in the - // -fullscreen method. if (self.videoOutput) { return !self.videoOutput->opts->fs; } else { - return NO; + return YES; } } -- cgit v1.2.3