summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa_common.m
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2015-03-08 11:00:29 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2015-03-08 11:56:56 +0100
commitce239f1577ccd7eabccaac5b3b34fbe3959d860e (patch)
treed11ba86383c3a6f46ce8c2ae61c9f0c2fcc9ff5c /video/out/cocoa_common.m
parent6172e843cd7313ea1c2cef9c75b0ce52449ecedb (diff)
downloadmpv-ce239f1577ccd7eabccaac5b3b34fbe3959d860e.tar.bz2
mpv-ce239f1577ccd7eabccaac5b3b34fbe3959d860e.tar.xz
cocoa: fix mouse hiding with launchpad and dock folders
Some UI elements in OS X – like Launchpad and Dock folders – are implemented using borderless windows in background demonized applications. When we use these elements, mpv doesn't stop to be the active application, but the mpv window leaves keyWindow state while we use the OS controls. This commit just keeps track of window state to update the cursor visibility accordingly. Fixes #513
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r--video/out/cocoa_common.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index c2cc2ece43..e4b0e9eca5 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -258,7 +258,7 @@ static int vo_cocoa_set_cursor_visibility(struct vo *vo, bool *visible)
if (*visible) {
CGDisplayShowCursor(kCGDirectMainDisplay);
- } else if ([v canHideCursor]) {
+ } else if ([v canHideCursor] && [s->window isKeyWindow]) {
CGDisplayHideCursor(kCGDirectMainDisplay);
} else {
*visible = true;
@@ -847,4 +847,10 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg)
struct vo_cocoa_state *s = self.vout->cocoa;
s->pending_events |= VO_EVENT_ICC_PROFILE_CHANGED;
}
+
+- (void)didChangeMousePosition
+{
+ struct vo_cocoa_state *s = self.vout->cocoa;
+ [(MpvEventsView *)s->view signalMousePosition];
+}
@end