window: report all double clicks
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 6 Aug 2017 13:53:16 +0000 (16:53 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 6 Aug 2017 18:26:12 +0000 (21:26 +0300)
Because we can.

include/vlc_vout_window.h
modules/gui/qt/components/interface_widgets.cpp
src/video_output/video_output.c

index f38ef15..f9a2a7d 100644 (file)
@@ -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);
 }
index d483461..ea0b209 100644 (file)
@@ -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
index 6b6dc8e..471dfcf 100644 (file)
@@ -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;