| 1 | From 2fb267db32b9a752dd16913c4bba308de1525a55 Mon Sep 17 00:00:00 2001
|
| 2 | From: =?UTF-8?q?Guido=20G=C3=BCnther?= <[email protected]>
|
| 3 | Date: Fri, 10 Mar 2023 12:25:13 +0100
|
| 4 | Subject: [PATCH] gdk/wayland: Track last touch serial on seat
|
| 5 |
|
| 6 | Since the touch data is released on touch up
|
| 7 | _gdk_wayland_seat_get_last_implicit_grab_serial will return 0 serial
|
| 8 | most of the time for touch only devices. This breaks xdg activation as
|
| 9 | the compositor will reject tokens that have a 0 serial set via
|
| 10 | xdg_activation_token_v1_set_serial.
|
| 11 |
|
| 12 | Avoid that by tracking touch serials on the seat itself too.
|
| 13 | ---
|
| 14 | gdk/wayland/gdkdevice-wayland.c | 6 +++++-
|
| 15 | 1 file changed, 5 insertions(+), 1 deletion(-)
|
| 16 |
|
| 17 | diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
|
| 18 | index 9dc86a32578..9570e82a7f9 100644
|
| 19 | |
| 20 | |
| 21 | @@ -212,6 +212,7 @@ struct _GdkWaylandSeat
|
| 22 | GdkKeymap *keymap;
|
| 23 |
|
| 24 | GHashTable *touches;
|
| 25 | + guint32 last_touch_down_serial;
|
| 26 | GList *tablets;
|
| 27 | GList *tablet_tools;
|
| 28 | GList *tablet_pads;
|
| 29 | @@ -2514,7 +2515,7 @@ touch_handle_down (void *data,
|
| 30 | touch = gdk_wayland_seat_add_touch (seat, id, wl_surface);
|
| 31 | touch->x = wl_fixed_to_double (x);
|
| 32 | touch->y = wl_fixed_to_double (y);
|
| 33 | - touch->touch_down_serial = serial;
|
| 34 | + seat->last_touch_down_serial = touch->touch_down_serial = serial;
|
| 35 |
|
| 36 | event = _create_touch_event (seat, touch, GDK_TOUCH_BEGIN, time);
|
| 37 |
|
| 38 | @@ -5398,6 +5399,9 @@ _gdk_wayland_seat_get_last_implicit_grab_serial (GdkSeat *seat,
|
| 39 | }
|
| 40 | }
|
| 41 |
|
| 42 | + if (wayland_seat->last_touch_down_serial > serial)
|
| 43 | + serial = wayland_seat->last_touch_down_serial;
|
| 44 | +
|
| 45 | return serial;
|
| 46 | }
|
| 47 |
|
| 48 | --
|
| 49 | GitLab
|
| 50 |
|