diff options
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r-- | video/out/cocoa_common.m | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 6f618c296c..9af5922cf1 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -829,6 +829,16 @@ int vo_cocoa_cgl_color_size(struct vo *vo) { if (self.videoOutput->opts->fs) vo_cocoa_display_cursor(self.videoOutput, 1); + + NSView *view = self.contentView; + NSPoint loc = [view convertPoint:[theEvent locationInWindow] fromView:nil]; + NSRect bounds = [view bounds]; + + int x = loc.x; + int y = - loc.y + bounds.size.height; // convert to x11-like coord system + if (CGRectContainsPoint(bounds, NSMakePoint(x, y))) { + vo_mouse_movement(self.videoOutput, x, y); + } } - (void)mouseDragged:(NSEvent *)theEvent |