summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-12-10 10:17:54 -0500
committerChris Michael <cp.michael@samsung.com>2014-12-10 12:01:58 -0500
commited12acbfc660d517e7697ddc16c553f796da4ae2 (patch)
tree81fc40add54fe78e9dd72fc081ef22940a3d16b8 /src/lib
parentce473d88a127e624fe22046865b3aff161c66f77 (diff)
ecore-drm: Transform touch events into output coordinates
Summary: This updates touch events to be transformed into output coordinates @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore_drm/ecore_drm_evdev.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c b/src/lib/ecore_drm/ecore_drm_evdev.c
index ee19c4ac03..604f98ef8b 100644
--- a/src/lib/ecore_drm/ecore_drm_evdev.c
+++ b/src/lib/ecore_drm/ecore_drm_evdev.c
@@ -9,17 +9,12 @@ static void
9_device_calibration_set(Ecore_Drm_Evdev *edev) 9_device_calibration_set(Ecore_Drm_Evdev *edev)
10{ 10{
11 const char *sysname; 11 const char *sysname;
12 int w = 0, h = 0;
13 float cal[6]; 12 float cal[6];
14 const char *device; 13 const char *device;
15 Eina_List *devices; 14 Eina_List *devices;
16 const char *vals; 15 const char *vals;
17 enum libinput_config_status status; 16 enum libinput_config_status status;
18 17
19 ecore_drm_output_size_get(edev->seat->input->dev,
20 edev->seat->input->dev->window, &w, &h);
21 if ((w == 0) || (h == 0)) return;
22
23 if ((!libinput_device_config_calibration_has_matrix(edev->device)) || 18 if ((!libinput_device_config_calibration_has_matrix(edev->device)) ||
24 (libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0)) 19 (libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0))
25 return; 20 return;
@@ -37,8 +32,8 @@ _device_calibration_set(Ecore_Drm_Evdev *edev)
37 &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6)) 32 &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6))
38 goto cont; 33 goto cont;
39 34
40 cal[2] /= w; 35 cal[2] /= edev->output.w;
41 cal[5] /= h; 36 cal[5] /= edev->output.h;
42 37
43 status = 38 status =
44 libinput_device_config_calibration_set_matrix(edev->device, cal); 39 libinput_device_config_calibration_set_matrix(edev->device, cal);
@@ -609,8 +604,10 @@ _device_handle_touch_down(struct libinput_device *device, struct libinput_event_
609 604
610 if (!(edev = libinput_device_get_user_data(device))) return; 605 if (!(edev = libinput_device_get_user_data(device))) return;
611 606
612 edev->mouse.x = libinput_event_touch_get_x(event); 607 edev->mouse.x =
613 edev->mouse.y = libinput_event_touch_get_y(event); 608 libinput_event_touch_get_x_transformed(event, edev->output.w);
609 edev->mouse.y =
610 libinput_event_touch_get_y_transformed(event, edev->output.h);
614 edev->mt_slot = libinput_event_touch_get_seat_slot(event); 611 edev->mt_slot = libinput_event_touch_get_seat_slot(event);
615 612
616 _device_handle_touch_event(edev, event, ECORE_EVENT_MOUSE_BUTTON_DOWN); 613 _device_handle_touch_event(edev, event, ECORE_EVENT_MOUSE_BUTTON_DOWN);
@@ -628,8 +625,10 @@ _device_handle_touch_motion(struct libinput_device *device, struct libinput_even
628 625
629 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return; 626 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
630 627
631 edev->mouse.x = libinput_event_touch_get_x(event); 628 edev->mouse.x =
632 edev->mouse.y = libinput_event_touch_get_y(event); 629 libinput_event_touch_get_x_transformed(event, edev->output.w);
630 edev->mouse.y =
631 libinput_event_touch_get_y_transformed(event, edev->output.h);
633 edev->mt_slot = libinput_event_touch_get_seat_slot(event); 632 edev->mt_slot = libinput_event_touch_get_seat_slot(event);
634 633
635 ev->window = (Ecore_Window)input->dev->window; 634 ev->window = (Ecore_Window)input->dev->window;
@@ -669,8 +668,8 @@ _device_handle_touch_up(struct libinput_device *device, struct libinput_event_to
669 668
670 if (!(edev = libinput_device_get_user_data(device))) return; 669 if (!(edev = libinput_device_get_user_data(device))) return;
671 670
672 edev->mouse.x = 0; 671 /* edev->mouse.x = 0; */
673 edev->mouse.y = 0; 672 /* edev->mouse.y = 0; */
674 edev->mt_slot = libinput_event_touch_get_seat_slot(event); 673 edev->mt_slot = libinput_event_touch_get_seat_slot(event);
675 674
676 _device_handle_touch_event(edev, event, ECORE_EVENT_MOUSE_BUTTON_UP); 675 _device_handle_touch_event(edev, event, ECORE_EVENT_MOUSE_BUTTON_UP);