summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa_common.m
diff options
context:
space:
mode:
authorRyan Goulden <percontation@gmail.com>2014-03-12 23:34:56 -0400
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-04-28 21:32:58 +0200
commit2878c2a914a0fae9342ab4d88e238f82a33b9d86 (patch)
tree981a6da1c615ee108456ff054e762fbdf1b8a57a /video/out/cocoa_common.m
parente8a996cedef347f9a4cee1172db39e7f0eea821f (diff)
downloadmpv-2878c2a914a0fae9342ab4d88e238f82a33b9d86.tar.bz2
mpv-2878c2a914a0fae9342ab4d88e238f82a33b9d86.tar.xz
cocoa: fix native fullscreen
This fixes a couple of issues with the Cocoa `--native-fs` mode, primarily: - A ghost titlebar at the top of the screen in full screen: This was caused by the window constraining code kicking in during fullscreen. Simply returning the unconstrained rect from the constraining method fixes the problem. - Incorrect behavior when using the titlebar buttons to enter/exit fullscreen, as opposed to the OSD button. This was caused by mpv's internal fullscreen state going out of sync with the NSWindow's one. This was the case because `toggleFullScreen:` completely bypassed the normal event flow that mpv expects. Signed-off-by: Ryan Goulden <percontation@gmail.com> Change style for mpv, simplify and refactor some of the constraining code. Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r--video/out/cocoa_common.m8
1 files changed, 3 insertions, 5 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index 7e660e9fae..8b6bea66dd 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -315,7 +315,6 @@ static void create_window(struct vo *vo, uint32_t d_width, uint32_t d_height,
if (opts->native_fs) {
[s->window setCollectionBehavior:
NSWindowCollectionBehaviorFullScreenPrimary];
- [NSApp setPresentationOptions:NSFullScreenWindowMask];
}
}
@@ -552,8 +551,6 @@ static void vo_cocoa_fullscreen(struct vo *vo)
if (s->icc_fs_profile_path != s->icc_wnd_profile_path)
s->icc_profile_path_changed = true;
- [s->window didChangeFullScreenState];
-
// Make the core aware of the view size change.
resize_window(vo);
}
@@ -791,9 +788,10 @@ int vo_cocoa_cgl_color_size(struct vo *vo)
- (void)putCommand:(char*)cmd
{
- mp_cmd_t *cmdt = mp_input_parse_cmd(self.vout->input_ctx, bstr0(cmd), "");
+ char *cmd_ = ta_strdup(NULL, cmd);
+ mp_cmd_t *cmdt = mp_input_parse_cmd(self.vout->input_ctx, bstr0(cmd_), "");
mp_input_queue_cmd(self.vout->input_ctx, cmdt);
- ta_free(cmd);
+ ta_free(cmd_);
}
- (void)performAsyncResize:(NSSize)size {