summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2017-02-20 17:25:21 +0100
committerAkemi <der.richter@gmx.de>2017-02-20 17:26:56 +0100
commitfffab30a3ef01dc6f34adadccb05617f4a3a528e (patch)
tree0642917b895344ce7c998e67151d6e05647bbe56
parentbdd096db9a8e70d8c70af4eec80c67d4807173f3 (diff)
downloadmpv-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.
-rw-r--r--video/out/cocoa/events_view.m1
-rw-r--r--video/out/cocoa/window.m5
-rw-r--r--video/out/cocoa_common.m14
3 files changed, 19 insertions, 1 deletions
diff --git a/video/out/cocoa/events_view.m b/video/out/cocoa/events_view.m
index 8be74d5e15..e6d536b776 100644
--- a/video/out/cocoa/events_view.m
+++ b/video/out/cocoa/events_view.m
@@ -211,6 +211,7 @@
{
if ([self.adapter mouseEnabled]) {
[self mouseUpEvent:event];
+ [self.adapter mouseUp];
} else {
[super mouseUp:event];
}
diff --git a/video/out/cocoa/window.m b/video/out/cocoa/window.m
index 1ff57acde9..028b17985f 100644
--- a/video/out/cocoa/window.m
+++ b/video/out/cocoa/window.m
@@ -204,6 +204,11 @@
[self.adapter windowDidDeminiaturize:notification];
}
+- (void)windowWillMove:(NSNotification *)notification
+{
+ [self.adapter windowWillMove:notification];
+}
+
- (BOOL)canBecomeMainWindow { return YES; }
- (BOOL)canBecomeKeyWindow { return YES; }
- (BOOL)windowShouldClose:(id)sender
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