summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@intel.com>2013-11-29 17:14:43 -0200
committerRafael Antognolli <rafael.antognolli@intel.com>2013-11-29 18:05:06 -0200
commitb92fc57c5acd039d97979334dcdc0847f09e568a (patch)
tree3958e5847fcd88ef8bd73bc4fb244fc1af76f5dd
parent64687356b087277e501a59de5a97bc6989e31093 (diff)
ecore/wayland: Remove list of touch points from input structure.
We already have the "Ecore_Wl_Mouse_Down_Info" list, that contains this information.
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_input.c46
-rw-r--r--src/lib/ecore_wayland/ecore_wl_private.h3
2 files changed, 4 insertions, 45 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c
index daa497cf0b..a9b7ac63c2 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -35,13 +35,6 @@
35# define BTN_BACK 0x116 35# define BTN_BACK 0x116
36#endif 36#endif
37 37
38typedef struct _Ecore_Wl_Touch_Point
39{
40 int id;
41 Ecore_Wl_Window *window;
42 struct wl_list link;
43} Ecore_Wl_Touch_Point;
44
45typedef struct _Ecore_Wl_Mouse_Down_Info 38typedef struct _Ecore_Wl_Mouse_Down_Info
46{ 39{
47 EINA_INLIST; 40 EINA_INLIST;
@@ -332,7 +325,6 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
332 &_ecore_wl_seat_listener, input); 325 &_ecore_wl_seat_listener, input);
333 wl_seat_set_user_data(input->seat, input); 326 wl_seat_set_user_data(input->seat, input);
334 327
335 wl_list_init(&input->touch_points);
336 wl_array_init(&input->data_types); 328 wl_array_init(&input->data_types);
337 329
338 input->data_device = 330 input->data_device =
@@ -358,11 +350,6 @@ _ecore_wl_input_del(Ecore_Wl_Input *input)
358 350
359 if (input->touch_focus) 351 if (input->touch_focus)
360 { 352 {
361 Ecore_Wl_Window *win = NULL;
362
363 if ((win = input->touch_focus))
364 win->touch_device = NULL;
365
366 input->touch_focus = NULL; 353 input->touch_focus = NULL;
367 } 354 }
368 355
@@ -1008,7 +995,6 @@ _ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch EINA_UNUSED, un
1008{ 995{
1009 Ecore_Wl_Input *input; 996 Ecore_Wl_Input *input;
1010 Ecore_Wl_Window *win; 997 Ecore_Wl_Window *win;
1011 Ecore_Wl_Touch_Point *point;
1012 998
1013 LOGFN(__FILE__, __LINE__, __FUNCTION__); 999 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1014 1000
@@ -1017,19 +1003,14 @@ _ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch EINA_UNUSED, un
1017 1003
1018 if (!(win = ecore_wl_window_surface_find(surface))) return; 1004 if (!(win = ecore_wl_window_surface_find(surface))) return;
1019 1005
1020 if (!(point = malloc(sizeof(Ecore_Wl_Touch_Point))))
1021 return;
1022
1023 point->id = id;
1024 point->window = win;
1025 wl_list_insert(&input->touch_points, &point->link);
1026
1027 input->touch_focus = win; 1006 input->touch_focus = win;
1028 input->timestamp = timestamp; 1007 input->timestamp = timestamp;
1029 input->display->serial = serial; 1008 input->display->serial = serial;
1030 input->sx = wl_fixed_to_int(x); 1009 input->sx = wl_fixed_to_int(x);
1031 input->sy = wl_fixed_to_int(y); 1010 input->sy = wl_fixed_to_int(y);
1032 1011
1012 _ecore_wl_input_mouse_move_send(input, input->pointer_focus, timestamp, id);
1013 _ecore_wl_input_cb_pointer_enter(data, NULL, serial, surface, x, y);
1033 _ecore_wl_input_mouse_down_send(input, input->touch_focus, 1014 _ecore_wl_input_mouse_down_send(input, input->touch_focus,
1034 id, 0, timestamp); 1015 id, 0, timestamp);
1035} 1016}
@@ -1038,7 +1019,6 @@ static void
1038_ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, int id) 1019_ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, int id)
1039{ 1020{
1040 Ecore_Wl_Input *input; 1021 Ecore_Wl_Input *input;
1041 Ecore_Wl_Touch_Point *point, *tmp;
1042 1022
1043 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1023 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1044 1024
@@ -1048,25 +1028,13 @@ _ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsi
1048 input->timestamp = timestamp; 1028 input->timestamp = timestamp;
1049 input->display->serial = serial; 1029 input->display->serial = serial;
1050 1030
1051 wl_list_for_each_safe(point, tmp, &input->touch_points, link) 1031 _ecore_wl_input_mouse_up_send(input, input->touch_focus, id, 0, timestamp);
1052 {
1053 if (point->id != id) continue;
1054
1055 _ecore_wl_input_mouse_up_send(input, input->touch_focus,
1056 id, 0, timestamp);
1057
1058 wl_list_remove(&point->link);
1059 free(point);
1060
1061 return;
1062 }
1063} 1032}
1064 1033
1065static void 1034static void
1066_ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int timestamp, int id, wl_fixed_t x, wl_fixed_t y) 1035_ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int timestamp, int id, wl_fixed_t x, wl_fixed_t y)
1067{ 1036{
1068 Ecore_Wl_Input *input; 1037 Ecore_Wl_Input *input;
1069 Ecore_Wl_Touch_Point *point;
1070 1038
1071 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1039 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1072 1040
@@ -1077,13 +1045,7 @@ _ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED,
1077 input->sx = wl_fixed_to_int(x); 1045 input->sx = wl_fixed_to_int(x);
1078 input->sy = wl_fixed_to_int(y); 1046 input->sy = wl_fixed_to_int(y);
1079 1047
1080 wl_list_for_each(point, &input->touch_points, link) 1048 _ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id);
1081 {
1082 if (point->id != id) continue;
1083 _ecore_wl_input_mouse_move_send(input,
1084 input->touch_focus, timestamp, id);
1085 return;
1086 }
1087} 1049}
1088 1050
1089static void 1051static void
diff --git a/src/lib/ecore_wayland/ecore_wl_private.h b/src/lib/ecore_wayland/ecore_wl_private.h
index adb9dcd4fc..80b454c0c2 100644
--- a/src/lib/ecore_wayland/ecore_wl_private.h
+++ b/src/lib/ecore_wayland/ecore_wl_private.h
@@ -138,7 +138,6 @@ struct _Ecore_Wl_Window
138 138
139 Ecore_Wl_Input *pointer_device; 139 Ecore_Wl_Input *pointer_device;
140 Ecore_Wl_Input *keyboard_device; 140 Ecore_Wl_Input *keyboard_device;
141 Ecore_Wl_Input *touch_device;
142 141
143 Eina_Bool anim_pending : 1; 142 Eina_Bool anim_pending : 1;
144 struct wl_callback *anim_callback; 143 struct wl_callback *anim_callback;
@@ -160,8 +159,6 @@ struct _Ecore_Wl_Input
160 struct wl_keyboard *keyboard; 159 struct wl_keyboard *keyboard;
161 160
162 struct wl_touch *touch; 161 struct wl_touch *touch;
163 struct wl_list touch_points;
164 int touch_count;
165 162
166 const char *cursor_name; 163 const char *cursor_name;
167 struct wl_cursor *cursor; 164 struct wl_cursor *cursor;