vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Thu May 31 21:04:34 2018 +0300| [d0a4204fb22939b1273dcbe7e22d33ab9cd917d8] | committer: Rémi Denis-Courmont
hotkeys: handle pop-up menu setting > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d0a4204fb22939b1273dcbe7e22d33ab9cd917d8 --- modules/control/hotkeys.c | 13 +++++++++++++ src/video_output/event.h | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c index c7faa28b4b..f00308b51a 100644 --- a/modules/control/hotkeys.c +++ b/modules/control/hotkeys.c @@ -168,10 +168,23 @@ static int ButtonEvent( vlc_object_t *p_this, char const *psz_var, else p_sys->vrnav.b_button_pressed = false; + if ((newval.i_int & (1 << MOUSE_BUTTON_LEFT)) + && !(oldval.i_int & (1 << MOUSE_BUTTON_LEFT))) + var_SetBool(p_intf->obj.libvlc, "intf-popupmenu", false); + if ((newval.i_int & (1 << MOUSE_BUTTON_CENTER)) && !(oldval.i_int & (1 << MOUSE_BUTTON_CENTER))) var_TriggerCallback(pl_Get(p_intf), "intf-toggle-fscontrol"); +#ifndef _WIN32 + if ((newval.i_int & (1 << MOUSE_BUTTON_RIGHT)) + && !(oldval.i_int & (1 << MOUSE_BUTTON_RIGHT))) +#else + if ((oldval.i_int & (1 << MOUSE_BUTTON_RIGHT)) + && !(newval.i_int & (1 << MOUSE_BUTTON_RIGHT))) +#endif + var_SetBool(p_intf->obj.libvlc, "intf-popupmenu", true); + return VLC_SUCCESS; } diff --git a/src/video_output/event.h b/src/video_output/event.h index a3727d2f06..1c17d79ff4 100644 --- a/src/video_output/event.h +++ b/src/video_output/event.h @@ -66,15 +66,10 @@ static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button) int x, y; var_GetCoords(vout, "mouse-moved", &x, &y); var_SetCoords(vout, "mouse-clicked", x, y); - var_SetBool(vout->obj.libvlc, "intf-popupmenu", false); return; } case MOUSE_BUTTON_CENTER: - return; case MOUSE_BUTTON_RIGHT: -#if !defined(_WIN32) - var_SetBool(vout->obj.libvlc, "intf-popupmenu", true); -#endif return; case MOUSE_BUTTON_WHEEL_UP: key = KEY_MOUSEWHEELUP; break; case MOUSE_BUTTON_WHEEL_DOWN: key = KEY_MOUSEWHEELDOWN; break; @@ -86,14 +81,6 @@ 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); -#if defined(_WIN32) - switch (button) - { - case MOUSE_BUTTON_RIGHT: - var_SetBool(vout->obj.libvlc, "intf-popupmenu", true); - return; - } -#endif } static inline void vout_SendEventMouseDoubleClick(vout_thread_t *vout) { _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
