[gtk: 5/7] recorder: Show scroll events deltas unit
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 5/7] recorder: Show scroll events deltas unit
- Date: Sat, 19 Mar 2022 00:47:11 +0000 (UTC)
commit 951e4ee6b28dcef76c9fc97d9f754d06c2527f13
Author: panoplie <59100-panoplie users noreply gitlab gnome org>
Date: Tue Feb 22 14:12:44 2022 +0100
recorder: Show scroll events deltas unit
gtk/inspector/recorder.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index 94930cba9e..48ff6105b7 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -1423,6 +1423,17 @@ gesture_phase_name (GdkTouchpadGesturePhase phase)
return name[phase];
}
+static const char *
+scroll_unit_name (GdkScrollUnit unit)
+{
+ if (unit == GDK_SCROLL_UNIT_WHEEL)
+ return "Wheel";
+ else if (unit == GDK_SCROLL_UNIT_SURFACE)
+ return "Surface";
+ else
+ return "Incorrect value";
+}
+
static void
populate_event_properties (GtkListStore *store,
GdkEvent *event)
@@ -1434,6 +1445,7 @@ populate_event_properties (GtkListStore *store,
double dx, dy;
char *tmp;
GdkModifierType state;
+ GdkScrollUnit scroll_unit;
gtk_list_store_clear (store);
@@ -1517,6 +1529,9 @@ populate_event_properties (GtkListStore *store,
tmp = g_strdup_printf ("%.2f %.2f", x, y);
add_text_row (store, "Delta", tmp);
g_free (tmp);
+
+ scroll_unit = gdk_scroll_event_get_unit (event);
+ add_text_row (store, "Unit", scroll_unit_name (scroll_unit));
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]