[vlc-devel] [PATCH] caopengllayer: Forward mouse events to other views as well
david.fuhrmann at gmail.com
david.fuhrmann at gmail.com
Tue Mar 31 09:11:08 CEST 2020
From: David Fuhrmann <dfuhrmann at videolan.org>
Other views might need the mouse events as well. Do the analog
logic as in the old macosx vout module.
Fixes steering of fullscreen panel.
fixes #24560
---
modules/video_output/caopengllayer.m | 34 ++++++++++++++++++----------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 739a3dcb10..bf16358591 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -643,10 +643,10 @@ - (void)mouseDown:(NSEvent *)event
!(event.modifierFlags & NSControlKeyMask) &&
event.clickCount == 1) {
vout_display_SendEventMousePressed(_vlc_vd, MOUSE_BUTTON_LEFT);
- } else {
- [super mouseDown:event];
}
}
+
+ [super mouseDown:event];
}
/* Left mouse button up */
@@ -662,6 +662,8 @@ - (void)mouseUp:(NSEvent *)event
vout_display_SendEventMouseReleased(_vlc_vd, MOUSE_BUTTON_LEFT);
}
}
+
+ [super mouseUp:event];
}
/* Middle mouse button down */
@@ -670,9 +672,9 @@ - (void)otherMouseDown:(NSEvent *)event
@synchronized(self) {
if (_vlc_vd)
vout_display_SendEventMousePressed(_vlc_vd, MOUSE_BUTTON_CENTER);
- else
- [super otherMouseDown:event];
}
+
+ [super otherMouseDown:event];
}
/* Middle mouse button up */
@@ -681,17 +683,15 @@ - (void)otherMouseUp:(NSEvent *)event
@synchronized(self) {
if (_vlc_vd)
vout_display_SendEventMouseReleased(_vlc_vd, MOUSE_BUTTON_CENTER);
- else
- [super otherMouseUp:event];
}
+
+ [super otherMouseUp:event];
}
-/* Mouse moved */
-- (void)mouseMoved:(NSEvent *)event
+- (void)mouseMovedInternal:(NSEvent *)event
{
@synchronized(self) {
if (!_vlc_vd) {
- [super mouseMoved:event];
return;
}
@@ -709,22 +709,32 @@ - (void)mouseMoved:(NSEvent *)event
}
}
+/* Mouse moved */
+- (void)mouseMoved:(NSEvent *)event
+{
+ [self mouseMovedInternal:event];
+ [super mouseMoved:event];
+}
+
/* Mouse moved while clicked */
- (void)mouseDragged:(NSEvent *)event
{
- [self mouseMoved:event];
+ [self mouseMovedInternal:event];
+ [super mouseDragged:event];
}
/* Mouse moved while center-clicked */
- (void)otherMouseDragged:(NSEvent *)event
{
- [self mouseMoved:event];
+ [self mouseMovedInternal:event];
+ [super otherMouseDragged:event];
}
/* Mouse moved while right-clicked */
- (void)rightMouseDragged:(NSEvent *)event
{
- [self mouseMoved:event];
+ [self mouseMovedInternal:event];
+ [super rightMouseDragged:event];
}
@end
--
2.21.1 (Apple Git-122.3)
More information about the vlc-devel
mailing list