elput: Return touch coordinates when we have no pointer
authorChris Michael <cp.michael@samsung.com>
Tue, 17 Jan 2017 16:34:24 +0000 (11:34 -0500)
committerChris Michael <cp.michael@samsung.com>
Tue, 17 Jan 2017 16:36:50 +0000 (11:36 -0500)
If a user calls elput_input_pointer_xy_get (as is done via
ecore_evas_drm) and a pointer does not exist, we never return any
coordinates for this function.

Enlightenment is using ecore_evas_pointer_xy_get (which when using the
drm ee, ends up calling elput_input_pointer_xy_get). If we have no
pointer device, then no coordinates are ever returned and touch
clicking does not function properly.

To fix that we will check if a touch device exists and supply the
coordinates from that (in the case where there is no pointer device).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/elput/elput_input.c

index 1dde85a..706e4f7 100644 (file)
@@ -425,6 +425,16 @@ elput_input_pointer_xy_get(Elput_Manager *manager, const char *seat, int *x, int
           continue;
         if (x) *x = eseat->ptr->x;
         if (y) *y = eseat->ptr->y;
+        return;
+     }
+
+   EINA_LIST_FOREACH(manager->input.seats, l, eseat)
+     {
+        if (!eseat->touch) continue;
+        if ((eseat->name) && (strcmp(eseat->name, seat)))
+          continue;
+        if (x) *x = eseat->touch->x;
+        if (y) *y = eseat->touch->y;
         break;
      }
 }