Alexandre Julliard : wineandroid: Force non-zero state on ACTION_BUTTON_RELEASE to avoid duplicate events.

Alexandre Julliard julliard at winehq.org
Thu Feb 1 16:14:53 CST 2018


Module: wine
Branch: master
Commit: 6a4fa30e4cbb714814ae1d1941004730646b1a5e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6a4fa30e4cbb714814ae1d1941004730646b1a5e

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Feb  1 16:06:13 2018 +0100

wineandroid: Force non-zero state on ACTION_BUTTON_RELEASE to avoid duplicate events.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wineandroid.drv/window.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c
index 7d2049d..aff687b 100644
--- a/dlls/wineandroid.drv/window.c
+++ b/dlls/wineandroid.drv/window.c
@@ -293,6 +293,9 @@ jboolean motion_event( JNIEnv *env, jobject obj, jint win, jint action, jint x,
            mask == AMOTION_EVENT_ACTION_BUTTON_RELEASE ))
         return JNI_FALSE;
 
+    /* make sure a subsequent AMOTION_EVENT_ACTION_UP is not treated as a touch event */
+    if (mask == AMOTION_EVENT_ACTION_BUTTON_RELEASE) state |= 0x80000000;
+
     prev_state = InterlockedExchange( &button_state, state );
 
     data.type = MOTION_EVENT;




More information about the wine-cvs mailing list