[vlc-devel] [PATCH 5/5] ios:vout: call vout_window_ReportMouseXXX directly

Steve Lhomme robux4 at ycbcr.xyz
Mon Nov 2 16:18:15 CET 2020


No need to use the old vout_display_SendMouseXXX calls
---
 modules/video_output/ios.m | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index 07c8355d45b..38e9295b3eb 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -85,6 +85,7 @@ vlc_module_end ()
 
 @interface VLCOpenGLES2VideoView : UIView {
     vout_display_t *_voutDisplay;
+    vout_window_t *_window;
     EAGLContext *_eaglContext;
     CAEAGLLayer *_layer;
 
@@ -371,6 +372,7 @@ static void GLESSwap(vlc_gl_t *gl)
     _eaglEnabled = YES;
     _bufferNeedReset = YES;
     _voutDisplay = vd;
+    _window = vd->cfg->window;
     _cfg = *_voutDisplay->cfg;
 
     vlc_mutex_init(&_mutex);
@@ -680,22 +682,15 @@ static void GLESSwap(vlc_gl_t *gl)
 - (void)tapRecognized:(UITapGestureRecognizer *)tapRecognizer
 {
     vlc_mutex_lock(&_mutex);
-    if (!_voutDisplay)
-    {
-        vlc_mutex_unlock(&_mutex);
-        return;
-    }
-
     UIGestureRecognizerState state = [tapRecognizer state];
     CGPoint touchPoint = [tapRecognizer locationInView:self];
     CGFloat scaleFactor = self.contentScaleFactor;
-    vout_display_SendMouseMovedDisplayCoordinates(_voutDisplay,
-                                                  (int)touchPoint.x * scaleFactor, (int)touchPoint.y * scaleFactor);
+    vlc_mutex_unlock(&_mutex);
 
-    vout_display_SendEventMousePressed(_voutDisplay, MOUSE_BUTTON_LEFT);
-    vout_display_SendEventMouseReleased(_voutDisplay, MOUSE_BUTTON_LEFT);
+    vout_window_ReportMouseMoved(_window, (int)touchPoint.x * scaleFactor, (int)touchPoint.y * scaleFactor);
 
-    vlc_mutex_unlock(&_mutex);
+    vout_window_ReportMousePressed(_window, MOUSE_BUTTON_LEFT);
+    vout_window_ReportMouseReleased(_window, MOUSE_BUTTON_LEFT);
 }
 
 - (void)updateVoutCfg:(const vout_display_cfg_t *)cfg withVGL:(vout_display_opengl_t *)vgl
-- 
2.26.2



More information about the vlc-devel mailing list