[vlc-commits] vout: simplify mouse-button-down updates

Rémi Denis-Courmont git at videolan.org
Thu May 31 20:45:48 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 31 21:24:40 2018 +0300| [00d436804871e2473e9cc01936c32d5924067705] | committer: Rémi Denis-Courmont

vout: simplify mouse-button-down updates

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

 src/video_output/display.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index eba0e0e3c2..d433535e77 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -1317,12 +1317,7 @@ void vout_SendDisplayEventMouse(vout_thread_t *vout, const vlc_mouse_t *m)
         var_SetCoords(vout, "mouse-moved", m->i_x, m->i_y);
 
     if (vlc_mouse_HasButton(&vout->p->mouse, m)) {
-        for (unsigned button = 0; button < MOUSE_BUTTON_MAX; button++) {
-            if (vlc_mouse_HasPressed(&vout->p->mouse, m, button))
-                var_OrInteger(vout, "mouse-button-down", 1 << button);
-            else if (vlc_mouse_HasReleased(&vout->p->mouse, m, button))
-                var_NAndInteger(vout, "mouse-button-down", 1 << button);
-        }
+        var_SetInteger(vout, "mouse-button-down", m->i_pressed);
 
         if (vlc_mouse_HasPressed(&vout->p->mouse, m, MOUSE_BUTTON_LEFT)) {
             /* FIXME? */



More information about the vlc-commits mailing list