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
This commit is contained in:
Stefano Pigozzi 2013-05-13 23:05:20 +02:00
parent a39d369c25
commit 4ce808cc2c
1 changed files with 9 additions and 13 deletions

View File

@ -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;
}
}