[gtk/gtk-4-6] inspector: Avoid another crash
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-4-6] inspector: Avoid another crash
- Date: Thu, 21 Apr 2022 23:29:08 +0000 (UTC)
commit 25bedcd85d6bad94fc3aee2861928ca6ee9dc917
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Apr 3 15:53:52 2022 -0400
inspector: Avoid another crash
We need to handle all event types here.
This was tripping over GDK_TOUCHPAD_HOLD events.
gtk/inspector/recorder.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index 94930cba9e..4ade80d279 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -1792,7 +1792,7 @@ static char *
get_event_summary (GdkEvent *event)
{
double x, y;
- int type;
+ GdkEventType type;
const char *name;
gdk_event_get_position (event, &x, &y);
@@ -1814,6 +1814,7 @@ get_event_summary (GdkEvent *event)
case GDK_TOUCH_CANCEL:
case GDK_TOUCHPAD_SWIPE:
case GDK_TOUCHPAD_PINCH:
+ case GDK_TOUCHPAD_HOLD:
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
return g_strdup_printf ("%s (%.2f %.2f)", name, x, y);
@@ -1839,6 +1840,7 @@ get_event_summary (GdkEvent *event)
case GDK_PAD_RING:
case GDK_PAD_STRIP:
case GDK_PAD_GROUP_MODE:
+ case GDK_DELETE:
return g_strdup_printf ("%s", name);
case GDK_SCROLL:
@@ -1853,6 +1855,7 @@ get_event_summary (GdkEvent *event)
}
break;
+ case GDK_EVENT_LAST:
default:
g_assert_not_reached ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]