summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-09-18 08:34:41 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-09-18 19:05:00 +0200
commitbb4ea8bb3e78b74b4eb2a621ab3a781a307c07c3 (patch)
tree1b60067e64d97f5a6c9547e7beccd992ab8001a2 /video
parenta08802016dd6074819dbc77365e871dc7086f296 (diff)
downloadmpv-bb4ea8bb3e78b74b4eb2a621ab3a781a307c07c3.tar.bz2
mpv-bb4ea8bb3e78b74b4eb2a621ab3a781a307c07c3.tar.xz
cocoa_common: signal a mouse movement when changing window size
This is mainly to avoid spurious cursor states due to the mouse moving inside or outside the window as a result of the window resize (with cmd-0/1/2). This avoids complex logic and triggers a mouse move so that the player recomputes the correct cursor state based on the autohide configuration of the user.
Diffstat (limited to 'video')
-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];