Bug 4576: remove touch/mouse duplication for linux/EVDEV
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
diff --git a/src/core/linux/SDL_evdev.c b/src/core/linux/SDL_evdev.c
index d0f9341..7b51e4b 100644
--- a/src/core/linux/SDL_evdev.c
+++ b/src/core/linux/SDL_evdev.c
@@ -90,7 +90,6 @@ typedef struct SDL_evdevlist_item
int x, y, pressure;
} * slots;
- int pointerFingerID;
} * touchscreen_data;
struct SDL_evdevlist_item *next;
@@ -234,7 +233,6 @@ SDL_EVDEV_Poll(void)
int mouse_button;
SDL_Mouse *mouse;
float norm_x, norm_y, norm_pressure;
- int abs_x, abs_y;
if (!_this) {
return;
@@ -383,36 +381,17 @@ SDL_EVDEV_Poll(void)
norm_pressure = 1.0f;
}
- abs_x = item->touchscreen_data->slots[j].x;
- abs_y = item->touchscreen_data->slots[j].y;
-
switch(item->touchscreen_data->slots[j].delta) {
case EVDEV_TOUCH_SLOTDELTA_DOWN:
- if (item->touchscreen_data->pointerFingerID == -1) {
- SDL_SendMouseMotion(mouse->focus, SDL_TOUCH_MOUSEID, 0, abs_x, abs_y);
-
- SDL_SendMouseButton(mouse->focus, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
- item->touchscreen_data->pointerFingerID = item->touchscreen_data->slots[j].tracking_id;
- }
-
SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, SDL_TRUE, norm_x, norm_y, norm_pressure);
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
break;
case EVDEV_TOUCH_SLOTDELTA_UP:
- if (item->touchscreen_data->pointerFingerID == item->touchscreen_data->slots[j].tracking_id) {
- SDL_SendMouseButton(mouse->focus, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
- item->touchscreen_data->pointerFingerID = -1;
- }
-
SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, SDL_FALSE, norm_x, norm_y, norm_pressure);
item->touchscreen_data->slots[j].tracking_id = -1;
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
break;
case EVDEV_TOUCH_SLOTDELTA_MOVE:
- if (item->touchscreen_data->pointerFingerID == item->touchscreen_data->slots[j].tracking_id) {
- SDL_SendMouseMotion(mouse->focus, SDL_TOUCH_MOUSEID, 0, abs_x, abs_y);
- }
-
SDL_SendTouchMotion(item->fd, item->touchscreen_data->slots[j].tracking_id, norm_x, norm_y, norm_pressure);
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
break;
@@ -540,8 +519,6 @@ SDL_EVDEV_init_touchscreen(SDL_evdevlist_item* item)
item->touchscreen_data->slots[i].tracking_id = -1;
}
- item->touchscreen_data->pointerFingerID = -1;
-
ret = SDL_AddTouch(item->fd, /* I guess our fd is unique enough */
SDL_TOUCH_DEVICE_DIRECT,
item->touchscreen_data->name);