summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/cocoa_common.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index d250cc2ec3..9a5945d82d 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -57,6 +57,7 @@
@property(nonatomic, assign) struct vo *videoOutput;
- (BOOL)canHideCursor;
- (void)recalcDraggableState;
+- (void)signalMousePosition;
@end
@interface NSScreen (mpvadditions)
@@ -729,6 +730,7 @@ int vo_cocoa_cgl_color_size(struct vo *vo)
.height = self.videoOutput->cocoa->aspdat.preh * multiplier
};
[self setCenteredContentSize:size];
+ [(GLMPlayerOpenGLView *)self.contentView signalMousePosition];
}
}
@@ -833,6 +835,12 @@ int vo_cocoa_cgl_color_size(struct vo *vo)
cocoa_put_key(MP_KEY_MOUSE_LEAVE);
}
+- (void)signalMousePosition
+{
+ NSPoint p = [self convertPoint:[self mouseLocation] fromView:nil];
+ vo_mouse_movement(self.videoOutput, p.x, p.y);
+}
+
- (void)signalMouseMovement:(NSEvent *)event
{
[self recalcDraggableState];