[gtk+] tests: Update testoverlay "Chase" testcase to gtk4 crossing events



commit 8a26fd3308364d3e2acaa84603c936ba1f474a1c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Sep 11 16:59:58 2017 +0200

    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.

 tests/testoverlay.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/tests/testoverlay.c b/tests/testoverlay.c
index a29b82f..b153415 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;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]