summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-05-13 23:05:20 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-05-13 23:41:03 +0200
commit4ce808cc2c648d3358ed0088ac3b0311c5ff37d5 (patch)
tree6cec82918caff59334957f7f4645a94012c7789b /video
parenta39d369c254ff6db3689b6f945bb057754510af7 (diff)
downloadmpv-4ce808cc2c648d3358ed0088ac3b0311c5ff37d5.tar.bz2
mpv-4ce808cc2c648d3358ed0088ac3b0311c5ff37d5.tar.xz
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
Diffstat (limited to 'video')
-rw-r--r--video/out/cocoa_common.m22
1 files changed, 9 insertions, 13 deletions
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;
}
}