[vlc-commits] window: report all double clicks

Rémi Denis-Courmont git at videolan.org
Sun Aug 6 20:27:50 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Aug  6 16:53:16 2017 +0300| [8bf2942e5d19f2759a2867bcb75f73bf3b9f6f59] | committer: Rémi Denis-Courmont

window: report all double clicks

Because we can.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8bf2942e5d19f2759a2867bcb75f73bf3b9f6f59
---

 include/vlc_vout_window.h                       | 5 +++--
 modules/gui/qt/components/interface_widgets.cpp | 5 +++--
 src/video_output/video_output.c                 | 3 ++-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h
index f38ef15cb7..f9a2a7dfa3 100644
--- a/include/vlc_vout_window.h
+++ b/include/vlc_vout_window.h
@@ -358,10 +358,11 @@ static inline void vout_window_ReportMouseReleased(vout_window_t *window,
 /**
  * Send a mouse double click event
  */
-static inline void vout_window_ReportMouseDoubleClick(vout_window_t *window)
+static inline void vout_window_ReportMouseDoubleClick(vout_window_t *window,
+                                                      int button)
 {
     const vout_window_mouse_event_t mouse = {
-        VOUT_WINDOW_MOUSE_DOUBLE_CLICK, 0, 0, 0,
+        VOUT_WINDOW_MOUSE_DOUBLE_CLICK, 0, 0, button,
     };
     vout_window_SendMouseEvent(window, &mouse);
 }
diff --git a/modules/gui/qt/components/interface_widgets.cpp b/modules/gui/qt/components/interface_widgets.cpp
index d483461cb5..ea0b209db3 100644
--- a/modules/gui/qt/components/interface_widgets.cpp
+++ b/modules/gui/qt/components/interface_widgets.cpp
@@ -349,9 +349,10 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event )
 
 void VideoWidget::mouseDoubleClickEvent( QMouseEvent *event )
 {
-    if( qtMouseButton2VLC( event->button() ) == 0 )
+    int vlc_button = qtMouseButton2VLC( event->button() );
+    if( vlc_button >= 0 )
     {
-        vout_window_ReportMouseDoubleClick( p_window );
+        vout_window_ReportMouseDoubleClick( p_window, vlc_button );
         event->accept();
     }
     else
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 6b6dc8e028..471dfcf7e1 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1335,7 +1335,8 @@ static void ThreadChangeWindowMouse(vout_thread_t *vout,
             vout_display_SendEventMouseReleased(vd, mouse->button_mask);
             break;
         case VOUT_WINDOW_MOUSE_DOUBLE_CLICK:
-            vout_display_SendEventMouseDoubleClick(vd);
+            if (mouse->button_mask == 0)
+                vout_display_SendEventMouseDoubleClick(vd);
             break;
         default: vlc_assert_unreachable();
             break;



More information about the vlc-commits mailing list