changeset 5651:7b1fbb71071b

[RT-34045] EGLFB: No move or drag events on simple touch screen Summary: There were 2 issues: 1) bug in udevInput - wrong if statement that cause a fault parsing of events 2) unit tests errors Tested-by: updated LinuxInputTest Reviewed-by: ddhill
author Assaf Yavani
date Wed, 06 Nov 2013 13:24:44 +0200
parents d408298723b6
children 143bcf17d534
files modules/graphics/src/main/native-glass/lens/input/udev/udevInput.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/native-glass/lens/input/udev/udevInput.c	Wed Nov 06 08:37:27 2013 +0000
+++ b/modules/graphics/src/main/native-glass/lens/input/udev/udevInput.c	Wed Nov 06 13:24:44 2013 +0200
@@ -1279,8 +1279,6 @@
 static void lens_input_pointerEvents_handleEvent(LensInputDevice *device,
                                                  struct input_event *event) {
 
-    lens_input_printEvent(*event);
-
     switch (event->type) {
         case EV_SYN:
             if (event->code == SYN_REPORT) {
@@ -1486,7 +1484,7 @@
             mouseState->pendingTouchPointCount = 1; //we always have 1 event
             mouseState->pendingTouchXs[0] = mouseState->pressedX;
             mouseState->pendingTouchYs[0] = mouseState->pressedY;
-        } else if (mouseState->pressedX == -1 && mouseState->pressedY != -1) {
+        } else if (touchButtonValue == -1 && mouseState->pressedX != -1 && mouseState->pressedY != -1) {
             GLASS_LOG_FINEST("ST - press event with no button on %d %d",
                              mouseState->pressedX,
                              mouseState->pressedY);
@@ -1494,6 +1492,10 @@
             mouseState->pendingTouchPointCount = 1; //we always have 1 event
             mouseState->pendingTouchXs[0] = mouseState->pressedX;
             mouseState->pendingTouchYs[0] = mouseState->pressedY;            
+        } else if (touchButtonValue == 0) {
+            //release
+             GLASS_LOG_FINEST("ST - RELEASE");
+
         }
     }
 
@@ -1755,7 +1757,7 @@
         //com_sun_glass_events_TouchEvent_TOUCH_RELEASED is never registered in
         //MouseState, so all previous touch events are press/move events and need
         // to be released
-        GLASS_LOG_FINEST("All points (%d) -> RELEASE", count+1);
+        GLASS_LOG_FINEST("All points (%d) -> RELEASE", count);
         for (i = 0; i < mouseState->touchPointCount; i++) {
             ids[i] = mouseState->touchIDs[i];
             xs[i] = mouseState->touchXs[i];