[vlc-devel] [PATCH 1/2] vout: set intf-popupmenu on right mouse release rather than mouse press
Pierre Lamot
pierre at videolabs.io
Wed Oct 25 17:59:32 CEST 2017
creating a popupmenu might lead to the mouse release events to be never
emitted, which leads to inconsistent mouse state, further events beeing
ignored.
For instance creating a modal widget or a QMenu in Qt
---
src/video_output/event.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/video_output/event.h b/src/video_output/event.h
index 78804c190c..df183fb11b 100644
--- a/src/video_output/event.h
+++ b/src/video_output/event.h
@@ -80,7 +80,6 @@ static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button)
var_ToggleBool(vout->obj.libvlc, "intf-toggle-fscontrol");
return;
case MOUSE_BUTTON_RIGHT:
- var_SetBool(vout->obj.libvlc, "intf-popupmenu", true);
return;
case MOUSE_BUTTON_WHEEL_UP: key = KEY_MOUSEWHEELUP; break;
case MOUSE_BUTTON_WHEEL_DOWN: key = KEY_MOUSEWHEELDOWN; break;
@@ -92,6 +91,11 @@ static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button)
static inline void vout_SendEventMouseReleased(vout_thread_t *vout, int button)
{
var_NAndInteger(vout, "mouse-button-down", 1 << button);
+ switch (button) {
+ case MOUSE_BUTTON_RIGHT:
+ var_SetBool(vout->obj.libvlc, "intf-popupmenu", true);
+ return;
+ }
}
static inline void vout_SendEventMouseDoubleClick(vout_thread_t *vout)
{
--
2.14.2
More information about the vlc-devel
mailing list