diff options
author | Akemi <der.richter@gmx.de> | 2017-02-20 17:25:21 +0100 |
---|---|---|
committer | Akemi <der.richter@gmx.de> | 2017-02-20 17:26:56 +0100 |
commit | fffab30a3ef01dc6f34adadccb05617f4a3a528e (patch) | |
tree | 0642917b895344ce7c998e67151d6e05647bbe56 /video/out/cocoa_common.m | |
parent | bdd096db9a8e70d8c70af4eec80c67d4807173f3 (diff) | |
download | mpv-fffab30a3ef01dc6f34adadccb05617f4a3a528e.tar.bz2 mpv-fffab30a3ef01dc6f34adadccb05617f4a3a528e.tar.xz |
cocoa: only report mouse movements when window is not being dragged
even though the mouse doesn’t move relative to the window itself, when
the window is being dragged, some outliers are still reported and
trigger the OSC.
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r-- | video/out/cocoa_common.m | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index cbadcf2d94..0d6f310662 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -76,6 +76,7 @@ struct vo_cocoa_state { bool cursor_visibility; bool cursor_visibility_wanted; + bool window_is_dragged; bool embedded; // wether we are embedding in another GUI @@ -946,8 +947,9 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg) - (void)signalMouseMovement:(NSPoint)point { - mp_input_set_mouse_pos(self.vout->input_ctx, point.x, point.y); [self recalcMovableByWindowBackground:point]; + if (!self.vout->cocoa->window_is_dragged) + mp_input_set_mouse_pos(self.vout->input_ctx, point.x, point.y); } - (void)putKeyEvent:(NSEvent*)event @@ -1052,4 +1054,14 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg) flag_events(self.vout, VO_EVENT_WIN_STATE); } +- (void)windowWillMove:(NSNotification *)notification +{ + self.vout->cocoa->window_is_dragged = true; +} + +- (void)mouseUp +{ + self.vout->cocoa->window_is_dragged = false; +} + @end |