keyboard: Handle touch up event
This fixes arrow keys which trigger on button up.
Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73169
diff --git a/clients/window.c b/clients/window.c
index d586244..be89b64 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -289,6 +289,7 @@
struct touch_point {
int32_t id;
+ float x, y;
struct widget *widget;
struct wl_list link;
};
@@ -3019,6 +3020,8 @@
if (tp) {
tp->id = id;
tp->widget = widget;
+ tp->x = sx;
+ tp->y = sy;
wl_list_insert(&input->touch_point_list, &tp->link);
if (widget->touch_down_handler)
@@ -3078,6 +3081,8 @@
if (tp->id != id)
continue;
+ tp->x = sx;
+ tp->y = sy;
if (tp->widget->touch_motion_handler)
(*tp->widget->touch_motion_handler)(tp->widget, input, time,
id, sx, sy,
@@ -3195,6 +3200,23 @@
*y = input->sy;
}
+int
+input_get_touch(struct input *input, int32_t id, float *x, float *y)
+{
+ struct touch_point *tp;
+
+ wl_list_for_each(tp, &input->touch_point_list, link) {
+ if (tp->id != id)
+ continue;
+
+ *x = tp->x;
+ *y = tp->y;
+ return 0;
+ }
+
+ return -1;
+}
+
struct display *
input_get_display(struct input *input)
{