From bb4ea8bb3e78b74b4eb2a621ab3a781a307c07c3 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 18 Sep 2013 08:34:41 +0200 Subject: 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. --- video/out/cocoa_common.m | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'video') 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]; -- cgit v1.2.3