summaryrefslogtreecommitdiff
path: root/src/lib/elput/elput_evdev.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-06-02 18:23:45 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-06-02 18:23:43 -0400
commitf220f086b991cd3aad306d7cbeb181e531d1dddb (patch)
tree31583caea5434fe92b3bd06922cd68e07747b9cd /src/lib/elput/elput_evdev.c
parent36dcd5719a2a82d91a468d9a23e9f09b22713492 (diff)
elput: move pointer coords into seat struct
@fix
Diffstat (limited to 'src/lib/elput/elput_evdev.c')
-rw-r--r--src/lib/elput/elput_evdev.c108
1 files changed, 54 insertions, 54 deletions
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index fb9d5a2bed..fca4042681 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -799,8 +799,8 @@ _pointer_motion_send(Elput_Device *edev)
799 ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)); 799 ev = calloc(1, sizeof(Ecore_Event_Mouse_Move));
800 if (!ev) return; 800 if (!ev) return;
801 801
802 x = ptr->x; 802 x = ptr->seat->pointer.x;
803 y = ptr->y; 803 y = ptr->seat->pointer.y;
804 804
805 if (x < ptr->minx) 805 if (x < ptr->minx)
806 x = ptr->minx; 806 x = ptr->minx;
@@ -812,8 +812,8 @@ _pointer_motion_send(Elput_Device *edev)
812 else if (y >= ptr->miny + ptr->seat->manager->input.pointer_h) 812 else if (y >= ptr->miny + ptr->seat->manager->input.pointer_h)
813 y = ptr->miny + ptr->seat->manager->input.pointer_h - 1; 813 y = ptr->miny + ptr->seat->manager->input.pointer_h - 1;
814 814
815 ptr->x = x; 815 ptr->seat->pointer.x = x;
816 ptr->y = y; 816 ptr->seat->pointer.y = y;
817 817
818 ev->window = edev->seat->manager->window; 818 ev->window = edev->seat->manager->window;
819 ev->event_window = edev->seat->manager->window; 819 ev->event_window = edev->seat->manager->window;
@@ -823,10 +823,10 @@ _pointer_motion_send(Elput_Device *edev)
823 ev->dev = edev->evas_device; 823 ev->dev = edev->evas_device;
824 if (ev->dev) efl_ref(ev->dev); 824 if (ev->dev) efl_ref(ev->dev);
825 825
826 ev->x = ptr->x; 826 ev->x = ptr->seat->pointer.x;
827 ev->y = ptr->y; 827 ev->y = ptr->seat->pointer.y;
828 ev->root.x = ptr->x; 828 ev->root.x = ptr->seat->pointer.x;
829 ev->root.y = ptr->y; 829 ev->root.y = ptr->seat->pointer.y;
830 830
831 kbd = _evdev_keyboard_get(edev->seat); 831 kbd = _evdev_keyboard_get(edev->seat);
832 if (kbd) _keyboard_modifiers_update(kbd, edev->seat); 832 if (kbd) _keyboard_modifiers_update(kbd, edev->seat);
@@ -841,10 +841,10 @@ _pointer_motion_send(Elput_Device *edev)
841 ev->multi.radius_y = 1; 841 ev->multi.radius_y = 1;
842 ev->multi.pressure = ptr->pressure; 842 ev->multi.pressure = ptr->pressure;
843 ev->multi.angle = 0.0; 843 ev->multi.angle = 0.0;
844 ev->multi.x = ptr->x; 844 ev->multi.x = ptr->seat->pointer.x;
845 ev->multi.y = ptr->y; 845 ev->multi.y = ptr->seat->pointer.y;
846 ev->multi.root.x = ptr->x; 846 ev->multi.root.x = ptr->seat->pointer.x;
847 ev->multi.root.y = ptr->y; 847 ev->multi.root.y = ptr->seat->pointer.y;
848 848
849 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, _event_free, ev->dev); 849 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, _event_free, ev->dev);
850} 850}
@@ -878,8 +878,8 @@ _pointer_motion(struct libinput_device *idev, struct libinput_event_pointer *eve
878 ptr = _evdev_pointer_get(edev->seat); 878 ptr = _evdev_pointer_get(edev->seat);
879 if (!ptr) return EINA_FALSE; 879 if (!ptr) return EINA_FALSE;
880 880
881 ptr->x += libinput_event_pointer_get_dx(event); 881 ptr->seat->pointer.x += libinput_event_pointer_get_dx(event);
882 ptr->y += libinput_event_pointer_get_dy(event); 882 ptr->seat->pointer.y += libinput_event_pointer_get_dy(event);
883 ptr->timestamp = libinput_event_pointer_get_time(event); 883 ptr->timestamp = libinput_event_pointer_get_time(event);
884 884
885 _pointer_motion_send(edev); 885 _pointer_motion_send(edev);
@@ -900,8 +900,8 @@ _pointer_motion_abs(struct libinput_device *idev, struct libinput_event_pointer
900 ptr = _evdev_pointer_get(edev->seat); 900 ptr = _evdev_pointer_get(edev->seat);
901 if (!ptr) return EINA_FALSE; 901 if (!ptr) return EINA_FALSE;
902 902
903 ptr->x = libinput_event_pointer_get_absolute_x_transformed(event, edev->ow); 903 ptr->seat->pointer.x = libinput_event_pointer_get_absolute_x_transformed(event, edev->ow);
904 ptr->y = libinput_event_pointer_get_absolute_y_transformed(event, edev->oh); 904 ptr->seat->pointer.y = libinput_event_pointer_get_absolute_y_transformed(event, edev->oh);
905 ptr->timestamp = libinput_event_pointer_get_time(event); 905 ptr->timestamp = libinput_event_pointer_get_time(event);
906 906
907 /* TODO: these needs to run a matrix transform based on output */ 907 /* TODO: these needs to run a matrix transform based on output */
@@ -934,10 +934,10 @@ _pointer_button_send(Elput_Device *edev, enum libinput_button_state state)
934 ev->dev = edev->evas_device; 934 ev->dev = edev->evas_device;
935 if (ev->dev) efl_ref(ev->dev); 935 if (ev->dev) efl_ref(ev->dev);
936 936
937 ev->x = ptr->x; 937 ev->x = ptr->seat->pointer.x;
938 ev->y = ptr->y; 938 ev->y = ptr->seat->pointer.y;
939 ev->root.x = ptr->x; 939 ev->root.x = ptr->seat->pointer.x;
940 ev->root.y = ptr->y; 940 ev->root.y = ptr->seat->pointer.y;
941 941
942 touch = _evdev_touch_get(edev->seat); 942 touch = _evdev_touch_get(edev->seat);
943 if (touch) ev->multi.device = touch->slot; 943 if (touch) ev->multi.device = touch->slot;
@@ -946,10 +946,10 @@ _pointer_button_send(Elput_Device *edev, enum libinput_button_state state)
946 ev->multi.radius_y = 1; 946 ev->multi.radius_y = 1;
947 ev->multi.pressure = ptr->pressure; 947 ev->multi.pressure = ptr->pressure;
948 ev->multi.angle = 0.0; 948 ev->multi.angle = 0.0;
949 ev->multi.x = ptr->x; 949 ev->multi.x = ptr->seat->pointer.x;
950 ev->multi.y = ptr->y; 950 ev->multi.y = ptr->seat->pointer.y;
951 ev->multi.root.x = ptr->x; 951 ev->multi.root.x = ptr->seat->pointer.x;
952 ev->multi.root.y = ptr->y; 952 ev->multi.root.y = ptr->seat->pointer.y;
953 953
954 ev->buttons = ptr->buttons; 954 ev->buttons = ptr->buttons;
955 955
@@ -1057,10 +1057,10 @@ _pointer_axis_send(Elput_Device *dev, int direction, int value)
1057 ev->dev = dev->evas_device; 1057 ev->dev = dev->evas_device;
1058 if (ev->dev) efl_ref(ev->dev); 1058 if (ev->dev) efl_ref(ev->dev);
1059 1059
1060 ev->x = ptr->x; 1060 ev->x = ptr->seat->pointer.x;
1061 ev->y = ptr->y; 1061 ev->y = ptr->seat->pointer.y;
1062 ev->root.x = ptr->x; 1062 ev->root.x = ptr->seat->pointer.x;
1063 ev->root.y = ptr->y; 1063 ev->root.y = ptr->seat->pointer.y;
1064 1064
1065 ev->z = value; 1065 ev->z = value;
1066 ev->direction = direction; 1066 ev->direction = direction;
@@ -1165,10 +1165,10 @@ _touch_event_send(Elput_Device *dev, int type)
1165 ev->timestamp = touch->timestamp; 1165 ev->timestamp = touch->timestamp;
1166 ev->same_screen = 1; 1166 ev->same_screen = 1;
1167 1167
1168 ev->x = touch->x; 1168 ev->x = touch->seat->pointer.x;
1169 ev->y = touch->y; 1169 ev->y = touch->seat->pointer.y;
1170 ev->root.x = touch->x; 1170 ev->root.x = touch->seat->pointer.x;
1171 ev->root.y = touch->y; 1171 ev->root.y = touch->seat->pointer.y;
1172 1172
1173 ev->modifiers = dev->seat->modifiers; 1173 ev->modifiers = dev->seat->modifiers;
1174 1174
@@ -1215,8 +1215,8 @@ _touch_motion_send(Elput_Device *dev)
1215 ev->dev = dev->evas_device; 1215 ev->dev = dev->evas_device;
1216 if (ev->dev) efl_ref(ev->dev); 1216 if (ev->dev) efl_ref(ev->dev);
1217 1217
1218 ev->x = lround(touch->x); 1218 ev->x = lround(touch->seat->pointer.x);
1219 ev->y = lround(touch->y); 1219 ev->y = lround(touch->seat->pointer.y);
1220 ev->root.x = ev->x; 1220 ev->root.x = ev->x;
1221 ev->root.y = ev->y; 1221 ev->root.y = ev->y;
1222 1222
@@ -1228,10 +1228,10 @@ _touch_motion_send(Elput_Device *dev)
1228 ev->multi.radius_y = 1; 1228 ev->multi.radius_y = 1;
1229 ev->multi.pressure = touch->pressure; 1229 ev->multi.pressure = touch->pressure;
1230 ev->multi.angle = 0.0; 1230 ev->multi.angle = 0.0;
1231 ev->multi.x = touch->x; 1231 ev->multi.x = touch->seat->pointer.x;
1232 ev->multi.y = touch->y; 1232 ev->multi.y = touch->seat->pointer.y;
1233 ev->multi.root.x = touch->x; 1233 ev->multi.root.x = touch->seat->pointer.x;
1234 ev->multi.root.y = touch->y; 1234 ev->multi.root.y = touch->seat->pointer.y;
1235 1235
1236 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, _event_free, ev->dev); 1236 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, _event_free, ev->dev);
1237} 1237}
@@ -1251,18 +1251,18 @@ _touch_down(struct libinput_device *idevice, struct libinput_event_touch *event)
1251 touch->slot = libinput_event_touch_get_seat_slot(event); 1251 touch->slot = libinput_event_touch_get_seat_slot(event);
1252 touch->timestamp = libinput_event_touch_get_time(event); 1252 touch->timestamp = libinput_event_touch_get_time(event);
1253 1253
1254 touch->x = libinput_event_touch_get_x_transformed(event, dev->ow); 1254 touch->seat->pointer.x = libinput_event_touch_get_x_transformed(event, dev->ow);
1255 touch->y = libinput_event_touch_get_y_transformed(event, dev->oh); 1255 touch->seat->pointer.y = libinput_event_touch_get_y_transformed(event, dev->oh);
1256 1256
1257 /* TODO: these needs to run a matrix transform based on output */ 1257 /* TODO: these needs to run a matrix transform based on output */
1258 /* _ecore_drm2_output_coordinate_transform(dev->output, */ 1258 /* _ecore_drm2_output_coordinate_transform(dev->output, */
1259 /* touch->x, touch->y, */ 1259 /* touch->seat->pointer.x, touch->seat->pointer.y, */
1260 /* &touch->x, &touch->y); */ 1260 /* &touch->seat->pointer.x, &touch->seat->pointer.y); */
1261 1261
1262 if (touch->slot == touch->grab.id) 1262 if (touch->slot == touch->grab.id)
1263 { 1263 {
1264 touch->grab.x = touch->x; 1264 touch->grab.x = touch->seat->pointer.x;
1265 touch->grab.y = touch->y; 1265 touch->grab.y = touch->seat->pointer.y;
1266 } 1266 }
1267 1267
1268 touch->points++; 1268 touch->points++;
@@ -1273,8 +1273,8 @@ _touch_down(struct libinput_device *idevice, struct libinput_event_touch *event)
1273 if (touch->points == 1) 1273 if (touch->points == 1)
1274 { 1274 {
1275 touch->grab.id = touch->slot; 1275 touch->grab.id = touch->slot;
1276 touch->grab.x = touch->x; 1276 touch->grab.x = touch->seat->pointer.x;
1277 touch->grab.y = touch->y; 1277 touch->grab.y = touch->seat->pointer.y;
1278 touch->grab.timestamp = touch->timestamp; 1278 touch->grab.timestamp = touch->timestamp;
1279 } 1279 }
1280} 1280}
@@ -1311,13 +1311,13 @@ _touch_motion(struct libinput_device *idevice, struct libinput_event_touch *even
1311 touch = _evdev_touch_get(dev->seat); 1311 touch = _evdev_touch_get(dev->seat);
1312 if (!touch) return; 1312 if (!touch) return;
1313 1313
1314 touch->x = libinput_event_touch_get_x_transformed(event, dev->ow); 1314 touch->seat->pointer.x = libinput_event_touch_get_x_transformed(event, dev->ow);
1315 touch->y = libinput_event_touch_get_y_transformed(event, dev->oh); 1315 touch->seat->pointer.y = libinput_event_touch_get_y_transformed(event, dev->oh);
1316 1316
1317 /* TODO: these needs to run a matrix transform based on output */ 1317 /* TODO: these needs to run a matrix transform based on output */
1318 /* _ecore_drm2_output_coordinate_transform(dev->output, */ 1318 /* _ecore_drm2_output_coordinate_transform(dev->output, */
1319 /* touch->x, touch->y, */ 1319 /* touch->seat->pointer.x, touch->seat->pointer.y, */
1320 /* &touch->x, &touch->y); */ 1320 /* &touch->seat->pointer.x, &touch->seat->pointer.y); */
1321 1321
1322 touch->slot = libinput_event_touch_get_seat_slot(event); 1322 touch->slot = libinput_event_touch_get_seat_slot(event);
1323 touch->timestamp = libinput_event_touch_get_time(event); 1323 touch->timestamp = libinput_event_touch_get_time(event);
@@ -1392,19 +1392,19 @@ _tablet_tool_axis(struct libinput_device *idev, struct libinput_event_tablet_too
1392 EINA_SAFETY_ON_NULL_RETURN(ptr); 1392 EINA_SAFETY_ON_NULL_RETURN(ptr);
1393 tool = libinput_event_tablet_tool_get_tool(event); 1393 tool = libinput_event_tablet_tool_get_tool(event);
1394 1394
1395 ptr->x = libinput_event_tablet_tool_get_x_transformed(event, dev->ow); 1395 ptr->seat->pointer.x = libinput_event_tablet_tool_get_x_transformed(event, dev->ow);
1396 ptr->y = libinput_event_tablet_tool_get_y_transformed(event, dev->oh); 1396 ptr->seat->pointer.y = libinput_event_tablet_tool_get_y_transformed(event, dev->oh);
1397 1397
1398 if (libinput_event_tablet_tool_x_has_changed(event)) 1398 if (libinput_event_tablet_tool_x_has_changed(event))
1399 { 1399 {
1400 ax[num].label = ECORE_AXIS_LABEL_X; 1400 ax[num].label = ECORE_AXIS_LABEL_X;
1401 ax[num].value = ptr->x; 1401 ax[num].value = ptr->seat->pointer.x;
1402 num++; 1402 num++;
1403 } 1403 }
1404 if (libinput_event_tablet_tool_y_has_changed(event)) 1404 if (libinput_event_tablet_tool_y_has_changed(event))
1405 { 1405 {
1406 ax[num].label = ECORE_AXIS_LABEL_Y; 1406 ax[num].label = ECORE_AXIS_LABEL_Y;
1407 ax[num].value = ptr->y; 1407 ax[num].value = ptr->seat->pointer.y;
1408 num++; 1408 num++;
1409 } 1409 }
1410 if (libinput_tablet_tool_has_pressure(tool)) 1410 if (libinput_tablet_tool_has_pressure(tool))