diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-01-15 23:34:13 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2018-01-16 14:14:10 -0500 |
commit | f90659cde8469de23cc47417108759375828695e (patch) | |
tree | 482cb1358d11d531e32a243992822f08e487faad | |
parent | 822f802aec716b7d61d401576bbfa8879b6fb383 (diff) | |
download | gtk+-f90659cde8469de23cc47417108759375828695e.tar.gz |
places sidebar: Stop using ::motion-notify-event
We can use the generic ::event signal here.
-rw-r--r-- | gtk/gtkplacessidebar.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 053625a33f..4a09742712 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -1696,20 +1696,23 @@ stop_drop_feedback (GtkPlacesSidebar *sidebar) } static gboolean -on_motion_notify_event (GtkWidget *widget, - GdkEventMotion *event, - gpointer user_data) +sidebar_event_cb (GtkWidget *widget, + GdkEvent *event, + gpointer user_data) { GtkPlacesSidebar *sidebar = GTK_PLACES_SIDEBAR (user_data); guint state; double x, y; + if (gdk_event_get_event_type (event) != GDK_MOTION_NOTIFY) + return GDK_EVENT_PROPAGATE; + if (sidebar->drag_row == NULL || sidebar->dragging_over) - return FALSE; + return GDK_EVENT_PROPAGATE; - if (!gdk_event_get_state ((GdkEvent *) event, &state) || + if (!gdk_event_get_state (event, &state) || !(state & GDK_BUTTON1_MASK)) - return FALSE; + return GDK_EVENT_PROPAGATE; gdk_event_get_coords ((GdkEvent *) event, &x, &y); @@ -1725,7 +1728,7 @@ on_motion_notify_event (GtkWidget *widget, sidebar->drag_x, sidebar->drag_y); } - return FALSE; + return GDK_EVENT_PROPAGATE; } static void @@ -4071,8 +4074,8 @@ gtk_places_sidebar_init (GtkPlacesSidebar *sidebar) sidebar->source_targets = gdk_content_formats_new (dnd_source_targets, G_N_ELEMENTS (dnd_source_targets)); sidebar->source_targets = gtk_content_formats_add_text_targets (sidebar->source_targets); - g_signal_connect (sidebar->list_box, "motion-notify-event", - G_CALLBACK (on_motion_notify_event), sidebar); + g_signal_connect (sidebar->list_box, "event", + G_CALLBACK (sidebar_event_cb), sidebar); g_signal_connect (sidebar->list_box, "drag-begin", G_CALLBACK (drag_begin_callback), sidebar); g_signal_connect (sidebar->list_box, "drag-motion", |