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.
This commit is contained in:
Carlos Garnacho 2017-09-11 16:59:58 +02:00
parent 7161b57063
commit 8a26fd3308

View File

@ -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;
}