summaryrefslogtreecommitdiff
path: root/gtk/gtkiconview.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-02-19 22:04:28 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-02-21 00:51:03 -0500
commitcadeca74e21a0990270b0527497bfcc0d6910158 (patch)
treea344b97c0ff7160469cdce989db1f52db3dc6c20 /gtk/gtkiconview.c
parent5a2f829a407241d784dd61e417f4d3166ab5e7a3 (diff)
downloadgtk+-cadeca74e21a0990270b0527497bfcc0d6910158.tar.gz
Go back to ::enter/::leave for pointer changes
These signals are behaving a little differently from what ::focus-in/::focus-out used to do.
Diffstat (limited to 'gtk/gtkiconview.c')
-rw-r--r--gtk/gtkiconview.c35
1 files changed, 12 insertions, 23 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 0efac0bac5..fdd62c29ba 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -166,10 +166,7 @@ static void gtk_icon_view_motion (GtkEventControl
double x,
double y,
gpointer user_data);
-static void gtk_icon_view_pointer (GtkEventController *controller,
- GtkCrossingDirection direction,
- double x,
- double y,
+static void gtk_icon_view_leave (GtkEventController *controller,
GdkCrossingMode mode,
gpointer user_data);
static void gtk_icon_view_button_press (GtkGestureClick *gesture,
@@ -967,10 +964,8 @@ gtk_icon_view_init (GtkIconView *icon_view)
gtk_widget_add_controller (GTK_WIDGET (icon_view), GTK_EVENT_CONTROLLER (gesture));
controller = gtk_event_controller_motion_new ();
- g_signal_connect (controller, "pointer-change", G_CALLBACK (gtk_icon_view_pointer),
- icon_view);
- g_signal_connect (controller, "motion", G_CALLBACK (gtk_icon_view_motion),
- icon_view);
+ g_signal_connect (controller, "leave", G_CALLBACK (gtk_icon_view_leave), icon_view);
+ g_signal_connect (controller, "motion", G_CALLBACK (gtk_icon_view_motion), icon_view);
gtk_widget_add_controller (GTK_WIDGET (icon_view), controller);
controller = gtk_event_controller_key_new ();
@@ -1883,26 +1878,20 @@ gtk_icon_view_motion (GtkEventController *controller,
}
static void
-gtk_icon_view_pointer (GtkEventController *controller,
- GtkCrossingDirection direction,
- double x,
- double y,
- GdkCrossingMode mode,
- gpointer user_data)
+gtk_icon_view_leave(GtkEventController *controller,
+ GdkCrossingMode mode,
+ gpointer user_data)
{
GtkIconView *icon_view;
GtkIconViewPrivate *priv;
- if (direction == GTK_CROSSING_OUT)
- {
- icon_view = GTK_ICON_VIEW (user_data);
- priv = icon_view->priv;
+ icon_view = GTK_ICON_VIEW (user_data);
+ priv = icon_view->priv;
- if (priv->last_prelight)
- {
- gtk_icon_view_queue_draw_item (icon_view, priv->last_prelight);
- priv->last_prelight = NULL;
- }
+ if (priv->last_prelight)
+ {
+ gtk_icon_view_queue_draw_item (icon_view, priv->last_prelight);
+ priv->last_prelight = NULL;
}
}