Fix touch-related compile errors on Linux.

This commit is contained in:
Alex Szpakowski 2019-08-04 16:56:40 -03:00
parent 6f8910e398
commit 109cbd6e8b
2 changed files with 19 additions and 5 deletions

View file

@ -401,18 +401,21 @@ SDL_EVDEV_Poll(void)
norm_pressure = 1.0f;
}
/* FIXME: the touch's window shouldn't be null, but
* the coordinate space of touch positions needs to
* be window-relative in that case. */
switch(item->touchscreen_data->slots[j].delta) {
case EVDEV_TOUCH_SLOTDELTA_DOWN:
SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, /* FIXME: window */, SDL_TRUE, norm_x, norm_y, norm_pressure);
SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, SDL_TRUE, norm_x, norm_y, norm_pressure);
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
break;
case EVDEV_TOUCH_SLOTDELTA_UP:
SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, /* FIXME: window */, SDL_FALSE, norm_x, norm_y, norm_pressure);
SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, 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:
SDL_SendTouchMotion(item->fd, item->touchscreen_data->slots[j].tracking_id, /* FIXME: window */, norm_x, norm_y, norm_pressure);
SDL_SendTouchMotion(item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, norm_x, norm_y, norm_pressure);
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
break;
default: