mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-31 14:18:40 +08:00
Pass the window along with evdev touch events
Fixes https://github.com/libsdl-org/SDL/issues/14644
This commit is contained in:
@@ -548,16 +548,16 @@ void SDL_EVDEV_Poll(void)
|
|||||||
* be window-relative in that case. */
|
* be window-relative in that case. */
|
||||||
switch (item->touchscreen_data->slots[j].delta) {
|
switch (item->touchscreen_data->slots[j].delta) {
|
||||||
case EVDEV_TOUCH_SLOTDELTA_DOWN:
|
case EVDEV_TOUCH_SLOTDELTA_DOWN:
|
||||||
SDL_SendTouch(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, SDL_EVENT_FINGER_DOWN, norm_x, norm_y, norm_pressure);
|
SDL_SendTouch(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, mouse->focus, SDL_EVENT_FINGER_DOWN, norm_x, norm_y, norm_pressure);
|
||||||
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
|
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
|
||||||
break;
|
break;
|
||||||
case EVDEV_TOUCH_SLOTDELTA_UP:
|
case EVDEV_TOUCH_SLOTDELTA_UP:
|
||||||
SDL_SendTouch(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, SDL_EVENT_FINGER_UP, norm_x, norm_y, norm_pressure);
|
SDL_SendTouch(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, mouse->focus, SDL_EVENT_FINGER_UP, norm_x, norm_y, norm_pressure);
|
||||||
item->touchscreen_data->slots[j].tracking_id = 0;
|
item->touchscreen_data->slots[j].tracking_id = 0;
|
||||||
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
|
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
|
||||||
break;
|
break;
|
||||||
case EVDEV_TOUCH_SLOTDELTA_MOVE:
|
case EVDEV_TOUCH_SLOTDELTA_MOVE:
|
||||||
SDL_SendTouchMotion(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, norm_x, norm_y, norm_pressure);
|
SDL_SendTouchMotion(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, mouse->focus, norm_x, norm_y, norm_pressure);
|
||||||
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
|
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user