From 25ae58fbbefc543be09c5910fee08017af3623f4 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 31 May 2013 14:16:27 +0200 Subject: cocoa_common: fix mouse autohide on MenuBar/Dock interaction This is needed after last commit. A bug within a bug (yo dawg)! Serious explaination in the source code comment so that it's not forgotten. --- video/out/cocoa_common.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index e541066a7c..8a83ed945d 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -863,8 +863,14 @@ int vo_cocoa_cgl_color_size(struct vo *vo) - (NSPoint) mouseLocation { + struct vo_cocoa_state *s = self.videoOutput->cocoa; NSPoint mLoc = [NSEvent mouseLocation]; - NSPoint wLoc = [self.window convertScreenToBase:mLoc]; + // Always use the "windowed" `s->window` to do hit detection since using + // self.window which points to and instance of NSFullScreenWindow while in + // fullscreen results in the cursor being reported to be *inside* the view + // even when accessing MenuBar and Dock. This results in the mouse behing + // autohidden upon inactivity on those case which is terrible, terrible UX. + NSPoint wLoc = [s->window convertScreenToBase:mLoc]; return [self convertPoint:wLoc fromView:nil]; } -- cgit v1.2.3