diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2018-10-12 17:35:44 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-10-15 17:39:04 +0200 |
commit | bb0e964f56e09eb50daff056b47c855fb252e37b (patch) | |
tree | e7e1fda452258f7a251bbadeb3f879a277f50a88 /testsuite | |
parent | 0f4a6bfbf8795b1821266eced0f38059283980ac (diff) | |
download | gtk+-bb0e964f56e09eb50daff056b47c855fb252e37b.tar.gz |
testsuite: Fix gestures test
Was broken by the removal of the default GtkEventControllerLegacy.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gtk/gestures.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/testsuite/gtk/gestures.c b/testsuite/gtk/gestures.c index 42aac2d65f..2115608983 100644 --- a/testsuite/gtk/gestures.c +++ b/testsuite/gtk/gestures.c @@ -198,16 +198,20 @@ state_nick (GtkEventSequenceState state) } typedef struct { + GtkEventController *controller; GString *str; gboolean exit; } LegacyData; static gboolean -legacy_cb (GtkWidget *w, GdkEvent *button, gpointer data) +legacy_cb (GtkEventControllerLegacy *c, GdkEvent *button, gpointer data) { if (gdk_event_get_event_type (button) == GDK_BUTTON_PRESS) { LegacyData *ld = data; + GtkWidget *w; + + w = gtk_event_controller_get_widget (ld->controller); if (ld->str->len > 0) g_string_append (ld->str, ", "); @@ -377,9 +381,12 @@ add_legacy (GtkWidget *w, GString *str, gboolean exit) LegacyData *data; data = g_new (LegacyData, 1); + data->controller = gtk_event_controller_legacy_new (); data->str = str; data->exit = exit; - g_signal_connect (w, "event", G_CALLBACK (legacy_cb), data); + + gtk_widget_add_controller (w, data->controller); + g_signal_connect (data->controller, "event", G_CALLBACK (legacy_cb), data); } static void |