vout: pass non-left-mouse-button double-clicks

This fixes #28377 -- the issue when double-clicking on
MOUSE_BUTTON_CENTER (mouse wheel) would result in plugins receiving
mouse events only for the first click, as VLC was filtering out all
non-left-mouse-button double-clicks.

The non-left-mouse-button double-click events, instead of being entirely
filtered out, are now being passed as regular mouse button presses
without any indication that they are double-clicks. While it would be
more proper to pass them as double-clicks with the corresponding mouse
button being pressed, that might break some 3rd party plugins that rely
on (vlc_mouse_t.b_double_click == true) to mean that the left mouse
button was double-clicked, without checking if the left mouse button was
actually pressed. Still, even with b_double_click not being set on
non-left-mouse-button double-clicks, passing such double-clicks as
regular press+release events does fix the issue of VLC "eating up" the
second click of a MOUSE_BUTTON_CENTER, so this is a good change.
This commit is contained in:
Maxim Biro 2023-09-22 00:10:59 -04:00 committed by Steve Lhomme
parent e031a5cc89
commit ed22580d6f
1 changed files with 2 additions and 0 deletions

View File

@ -1427,6 +1427,8 @@ static void ThreadChangeWindowMouse(vout_thread_t *vout,
case VOUT_WINDOW_MOUSE_DOUBLE_CLICK:
if (mouse->button_mask == 0)
vout_display_SendEventMouseDoubleClick(vd);
else
vout_display_SendEventMousePressed(vd, mouse->button_mask);
break;
default: vlc_assert_unreachable();
break;