[mutter/wip/carlosg/theres-no-end] wayland: Warn and fix accounting on missed CLUTTER_TOUCH_END events
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/theres-no-end] wayland: Warn and fix accounting on missed CLUTTER_TOUCH_END events
- Date: Wed, 19 Jan 2022 22:08:01 +0000 (UTC)
commit 6e0939ac24f71db211ad7163d7bac6d16bde964a
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jan 17 13:18:53 2022 +0100
wayland: Warn and fix accounting on missed CLUTTER_TOUCH_END events
If we happen to handle a CLUTTER_TOUCH_BEGIN without a corresponding
CLUTTER_TOUCH_END at MetaWaylandTouch, we would still attempt to
reuse the older MetaWaylandTouchInfo, resulting in an assert triggered
as there is a stale touch reference on the previous surface.
Warn in place and create a new touch info struct to still fix the
broken surface accounting, instead of finding out the hard
way after the surface is destroyed. The assert is preserved to ensure
the accounting does not sneakily break anymore/further.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/584
src/wayland/meta-wayland-touch.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/wayland/meta-wayland-touch.c b/src/wayland/meta-wayland-touch.c
index 15f0312eb3..0280195e8e 100644
--- a/src/wayland/meta-wayland-touch.c
+++ b/src/wayland/meta-wayland-touch.c
@@ -177,8 +177,11 @@ touch_get_info (MetaWaylandTouch *touch,
touch_info = g_hash_table_lookup (touch->touches, sequence);
- if (!touch_info && create)
+ if (create)
{
+ if (touch_info != NULL)
+ g_warning ("Stale touch information for sequence slot %p", sequence);
+
touch_info = g_new0 (MetaWaylandTouchInfo, 1);
touch_info->slot = clutter_event_sequence_get_slot (sequence);
g_hash_table_insert (touch->touches, sequence, touch_info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]