summaryrefslogtreecommitdiff
path: root/gtk/gtktreepopover.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-02-15 20:47:23 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-02-21 00:50:59 -0500
commite3158a1bfb4580b9a9d6901453a4bde02394e6ec (patch)
treeffa43c3a033640b0ca75e86d02529e95a1aea5fd /gtk/gtktreepopover.c
parent23c67f8c672ee3c0a3e22afd71ac86f96592dca5 (diff)
downloadgtk+-e3158a1bfb4580b9a9d6901453a4bde02394e6ec.tar.gz
Make crossing events handled the same way
Diffstat (limited to 'gtk/gtktreepopover.c')
-rw-r--r--gtk/gtktreepopover.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/gtk/gtktreepopover.c b/gtk/gtktreepopover.c
index ee98a9d763..019090e9aa 100644
--- a/gtk/gtktreepopover.c
+++ b/gtk/gtktreepopover.c
@@ -619,30 +619,23 @@ item_activated_cb (GtkGesture *gesture,
}
static void
-enter_cb (GtkEventController *controller,
- double x,
- double y,
- GdkCrossingMode mode,
- GdkNotifyType type,
- GtkTreePopover *popover)
+pointer_change_cb (GtkEventController *controller,
+ GtkCrossingDirection direction,
+ double x,
+ double y,
+ GdkCrossingMode mode,
+ GtkTreePopover *popover)
{
GtkWidget *item;
item = gtk_event_controller_get_widget (controller);
- if (gtk_event_controller_motion_contains_pointer (GTK_EVENT_CONTROLLER_MOTION (controller)))
+ if (direction == GTK_CROSSING_IN)
{
- gtk_tree_popover_set_active_item (popover, item);
+ if (gtk_event_controller_motion_contains_pointer (GTK_EVENT_CONTROLLER_MOTION (controller)))
+ gtk_tree_popover_set_active_item (popover, item);
}
}
-static void
-leave_cb (GtkEventController *controller,
- GdkCrossingMode mode,
- GdkNotifyType type,
- GtkTreePopover *popover)
-{
-}
-
static GtkWidget *
gtk_tree_popover_create_item (GtkTreePopover *popover,
GtkTreePath *path,
@@ -700,8 +693,7 @@ gtk_tree_popover_create_item (GtkTreePopover *popover,
gtk_widget_add_controller (item, GTK_EVENT_CONTROLLER (controller));
controller = gtk_event_controller_motion_new ();
- g_signal_connect (controller, "enter", G_CALLBACK (enter_cb), popover);
- g_signal_connect (controller, "leave", G_CALLBACK (leave_cb), popover);
+ g_signal_connect (controller, "pointer-change", G_CALLBACK (pointer_change_cb), popover);
gtk_widget_add_controller (item, controller);
g_object_set_data (G_OBJECT (item), "is-header", GINT_TO_POINTER (header_item));