touch = calloc(1, sizeof(Elput_Touch));
if (!touch) return NULL;
- touch->x = -1;
- touch->y = -1;
touch->seat = seat;
return touch;
}
static void
+_touch_motion_send(Elput_Device *dev)
+{
+ Elput_Touch *touch;
+ Ecore_Event_Mouse_Move *ev;
+
+ touch = _evdev_touch_get(dev->seat);
+ if (!touch) return;
+
+ ev = calloc(1, sizeof(Ecore_Event_Mouse_Move));
+ if (!ev) return;
+
+ ev->window = dev->seat->manager->window;
+ ev->event_window = dev->seat->manager->window;
+ ev->root_window = dev->seat->manager->window;
+ ev->timestamp = touch->timestamp;
+ ev->same_screen = 1;
+
+ ev->x = touch->x;
+ ev->y = touch->y;
+ ev->root.x = touch->x;
+ ev->root.y = touch->y;
+
+ ev->modifiers = dev->seat->modifiers;
+
+ ev->multi.device = touch->slot;
+ ev->multi.radius = 1;
+ ev->multi.radius_x = 1;
+ ev->multi.radius_y = 1;
+ ev->multi.pressure = 1.0;
+ ev->multi.angle = 0.0;
+ ev->multi.x = ev->x;
+ ev->multi.y = ev->y;
+ ev->multi.root.x = ev->x;
+ ev->multi.root.y = ev->y;
+
+ ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
+}
+
+static void
_touch_down(struct libinput_device *idevice, struct libinput_event_touch *event)
{
Elput_Device *dev;
touch->points++;
+ _touch_motion_send(dev);
_touch_event_send(dev, ECORE_EVENT_MOUSE_BUTTON_DOWN);
if (touch->points == 1)
touch->points--;
touch->slot = libinput_event_touch_get_seat_slot(event);
touch->timestamp = libinput_event_touch_get_time(event);
- touch->x = 0;
- touch->y = 0;
+ _touch_motion_send(dev);
_touch_event_send(dev, ECORE_EVENT_MOUSE_BUTTON_UP);
}
static void
-_touch_motion_send(Elput_Device *dev)
-{
- Elput_Touch *touch;
- Ecore_Event_Mouse_Move *ev;
-
- touch = _evdev_touch_get(dev->seat);
- if (!touch) return;
-
- ev = calloc(1, sizeof(Ecore_Event_Mouse_Move));
- if (!ev) return;
-
- ev->window = dev->seat->manager->window;
- ev->event_window = dev->seat->manager->window;
- ev->root_window = dev->seat->manager->window;
- ev->timestamp = touch->timestamp;
- ev->same_screen = 1;
-
- ev->x = touch->x;
- ev->y = touch->y;
- ev->root.x = touch->x;
- ev->root.y = touch->y;
-
- ev->modifiers = dev->seat->modifiers;
-
- ev->multi.device = touch->slot;
- ev->multi.radius = 1;
- ev->multi.radius_x = 1;
- ev->multi.radius_y = 1;
- ev->multi.pressure = 1.0;
- ev->multi.angle = 0.0;
- ev->multi.x = ev->x;
- ev->multi.y = ev->y;
- ev->multi.root.x = ev->x;
- ev->multi.root.y = ev->y;
-
- ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
-}
-
-static void
_touch_motion(struct libinput_device *idevice, struct libinput_event_touch *event)
{
Elput_Device *dev;