summaryrefslogtreecommitdiff
path: root/tests/testoverlay.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2017-09-11 16:59:58 +0200
committerCarlos Garnacho <carlosg@gnome.org>2017-09-15 21:11:22 +0200
commit8a26fd3308364d3e2acaa84603c936ba1f474a1c (patch)
tree98a63d53fc5946a4f65946f5ce0dc6da4fe40cfe /tests/testoverlay.c
parent7161b57063d56a01bd7fb127c1ee1109add98cb7 (diff)
downloadgtk+-8a26fd3308364d3e2acaa84603c936ba1f474a1c.tar.gz
tests: Update testoverlay "Chase" testcase to gtk4 crossing events
The intent is detecting enter events into the overlayed label, so just connect to ::enter-notify-event on the label with no GdkWindow checks.
Diffstat (limited to 'tests/testoverlay.c')
-rw-r--r--tests/testoverlay.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/testoverlay.c b/tests/testoverlay.c
index a29b82fbe2..b153415fb1 100644
--- a/tests/testoverlay.c
+++ b/tests/testoverlay.c
@@ -315,11 +315,8 @@ test_builder (void)
}
static void
-on_enter (GtkWidget *overlay, GdkEventCrossing *event, GtkWidget *child)
+on_enter (GtkWidget *child, GdkEventCrossing *event, GtkWidget *overlay)
{
- if (event->window != gtk_widget_get_window (child))
- return;
-
if (gtk_widget_get_halign (child) == GTK_ALIGN_START)
gtk_widget_set_halign (child, GTK_ALIGN_END);
else
@@ -372,8 +369,8 @@ test_chase (void)
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
g_object_set (child, "margin", 4, NULL);
- g_signal_connect (overlay, "enter-notify-event",
- G_CALLBACK (on_enter), child);
+ g_signal_connect (child, "enter-notify-event",
+ G_CALLBACK (on_enter), overlay);
return win;
}