summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/cocoa/events_view.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/video/out/cocoa/events_view.m b/video/out/cocoa/events_view.m
index eda4781418..8be74d5e15 100644
--- a/video/out/cocoa/events_view.m
+++ b/video/out/cocoa/events_view.m
@@ -86,7 +86,19 @@
- (BOOL)containsMouseLocation
{
+ CGFloat topMargin = 0.0;
+ CGFloat menuBarHeight = [[NSApp mainMenu] menuBarHeight];
+
+ // menuBarHeight is 0 when menu bar is hidden in fullscreen
+ // 1pt to compensate of the black line beneath the menu bar
+ if ([self.adapter isInFullScreenMode] && menuBarHeight > 0) {
+ NSRect tr = [NSWindow frameRectForContentRect:CGRectZero
+ styleMask:NSWindowStyleMaskTitled];
+ topMargin = tr.size.height + 1 + menuBarHeight;
+ }
+
NSRect vF = [[self.window screen] frame];
+ vF.size.height -= topMargin;
NSRect vFW = [self.window convertRectFromScreen:vF];
NSRect vFV = [self convertRect:vFW fromView:nil];
NSPoint pt = [self convertPoint:[self mouseLocation] fromView:nil];