summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-01-15 23:56:14 -0500
committerMatthias Clasen <mclasen@redhat.com>2018-01-16 14:14:10 -0500
commit0c1ac9add4a7b2a4233a2edf1c521a67822a2af2 (patch)
tree32ec2c53e71eeb8a08bc49920d43abb6a247f085 /testsuite
parenta2bce67d3b09e03dffef7d69e333fe140cc3e73b (diff)
downloadgtk+-0c1ac9add4a7b2a4233a2edf1c521a67822a2af2.tar.gz
testsuite: Stop using ::button-press-event
We can use the generic ::event signal instead.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gtk/gestures.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/testsuite/gtk/gestures.c b/testsuite/gtk/gestures.c
index 3a3adc0a07..78331c8af3 100644
--- a/testsuite/gtk/gestures.c
+++ b/testsuite/gtk/gestures.c
@@ -203,15 +203,20 @@ typedef struct {
} LegacyData;
static gboolean
-legacy_cb (GtkWidget *w, GdkEventButton *button, gpointer data)
+legacy_cb (GtkWidget *w, GdkEvent *button, gpointer data)
{
- LegacyData *ld = data;
+ if (gdk_event_get_event_type (button) == GDK_BUTTON_PRESS)
+ {
+ LegacyData *ld = data;
+
+ if (ld->str->len > 0)
+ g_string_append (ld->str, ", ");
+ g_string_append_printf (ld->str, "legacy %s", gtk_widget_get_name (w));
- if (ld->str->len > 0)
- g_string_append (ld->str, ", ");
- g_string_append_printf (ld->str, "legacy %s", gtk_widget_get_name (w));
+ return ld->exit;
+ }
- return ld->exit;
+ return GDK_EVENT_PROPAGATE;
}
typedef struct {
@@ -372,7 +377,7 @@ add_legacy (GtkWidget *w, GString *str, gboolean exit)
data = g_new (LegacyData, 1);
data->str = str;
data->exit = exit;
- g_signal_connect (w, "button-press-event", G_CALLBACK (legacy_cb), data);
+ g_signal_connect (w, "event", G_CALLBACK (legacy_cb), data);
}
static void