Only send touch up events on destroy if the touch is down

Otherwise we trig a bug error message every time we unref the touch.
This commit is contained in:
Peter Hutterer 2022-04-29 10:51:56 +10:00
parent ea6a348399
commit cede41d190
2 changed files with 4 additions and 2 deletions

View file

@ -572,7 +572,8 @@ OBJECT_IMPLEMENT_SETTER(ei_touch, user_data, void *);
static void
ei_touch_destroy(struct ei_touch *touch)
{
ei_touch_up(touch);
if (touch->state == TOUCH_IS_DOWN)
ei_touch_up(touch);
ei_device_unref(touch->device);
}

View file

@ -529,7 +529,8 @@ OBJECT_IMPLEMENT_SETTER(eis_touch, user_data, void *);
static void
eis_touch_destroy(struct eis_touch *touch)
{
eis_touch_up(touch);
if (touch->state == TOUCH_IS_DOWN)
eis_touch_up(touch);
eis_device_unref(touch->device);
}