changeset 7124:7046a069715f

RT-37098 [Monocle]: Multitouch tests fail with DellP2714TDevice
author Daniel Blaukopf <daniel.blaukopf@oracle.com>
date Sun, 25 May 2014 14:07:17 +0300
parents 98c5c6958435
children 03201923b37e
files modules/graphics/src/main/java/com/sun/glass/ui/monocle/linux/LinuxStatefulMultiTouchProcessor.java tests/system/src/test/java/com/sun/glass/ui/monocle/input/devices/DellP2714TDevice.java tests/system/src/test/java/com/sun/glass/ui/monocle/input/devices/TestTouchDevices.java
diffstat 3 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/linux/LinuxStatefulMultiTouchProcessor.java	Sun May 25 13:26:30 2014 +0300
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/linux/LinuxStatefulMultiTouchProcessor.java	Sun May 25 14:07:17 2014 +0300
@@ -65,8 +65,9 @@
                             if (currentID != ID_UNASSIGNED
                                     && (x != COORD_UNDEFINED || y != COORD_UNDEFINED)) {
                                 updatePoint(x, y);
+                                x = y = COORD_UNDEFINED;
                             }
-                            // We expect ABS_MT_SLOT and  // ABS_MT_TRACKING_ID
+                            // We expect ABS_MT_SLOT and ABS_MT_TRACKING_ID
                             // to precede the coordinates they describe
                             currentSlot = value;
                             currentID = slotToIDMap.getOrDefault(currentSlot,
@@ -85,11 +86,15 @@
                             break;
                         case Input.ABS_X:
                         case Input.ABS_MT_POSITION_X:
-                            x = value;
+                            if (x == COORD_UNDEFINED) {
+                                x = value;
+                            }
                             break;
                         case Input.ABS_Y:
                         case Input.ABS_MT_POSITION_Y:
-                            y = value;
+                            if (y == COORD_UNDEFINED) {
+                                y = value;
+                            }
                             break;
                     }
                     break;
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/devices/DellP2714TDevice.java	Sun May 25 13:26:30 2014 +0300
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/devices/DellP2714TDevice.java	Sun May 25 14:07:17 2014 +0300
@@ -26,17 +26,16 @@
 package com.sun.glass.ui.monocle.input.devices;
 
 import com.sun.glass.ui.monocle.input.TestApplication;
-import com.sun.glass.ui.monocle.input.TestLog;
 import com.sun.glass.ui.monocle.input.UInput;
 import org.junit.Assume;
 
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
-import java.util.Set;
 
 /**
- * TouchRevolutionFusionDevice sends ABS_MT_POSITION_X and ABS_MT_POSITION_Y
+ * Dell P2714 touch screen monitor.
+ *
+ * DellP2714TDevice sends ABS_MT_POSITION_X and ABS_MT_POSITION_Y
  * events per each touch-point.
  * ABS_X & ABS_Y events are being sent only once per touch-event
  * and are equal to ABS_MT_POSITION_X and ABS_MT_POSITION_Y of first touch-point.
@@ -56,14 +55,13 @@
     private boolean absXUpdated = false;
     private boolean absYUpdated = false;
 
-    private Set<Integer> modifiedPoints = new HashSet<>();
-
     public DellP2714TDevice() {
         super(10);
     }
 
     @Override
     public void create() {
+        Assume.assumeTrue(TestApplication.isMonocle());
         ui = new UInput();
         ui.processLine("OPEN");
         ui.processLine("EVBIT EV_SYN");
@@ -193,4 +191,4 @@
         }
         super.sync();
     }
-}
\ No newline at end of file
+}
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/devices/TestTouchDevices.java	Sun May 25 13:26:30 2014 +0300
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/devices/TestTouchDevices.java	Sun May 25 14:07:17 2014 +0300
@@ -59,7 +59,8 @@
                 new TouchRevolutionFusionDevice(),
                 new NTrigDevice(),
                 new SamsungLMS700KF07004Device(),
-                new TabletDevice()
+                new TabletDevice(),
+                new DellP2714TDevice(),
         }));
         return devices;
     }