[nautilus/wip/coreyberla/dnd-threshold: 13/13] list-base: Stop listening to "enter" signal for GtkDropControllerMotion




commit be5ce8b908e423af2ffc3006e312ca61d33e839e
Author: Corey Berla <corey berla me>
Date:   Mon Aug 8 20:38:46 2022 -0700

    list-base: Stop listening to "enter" signal for GtkDropControllerMotion
    
    Now that we are listening to the "motion" signal when hovering over
    folders, it's no longer necessary to listen to "enter" since we are
    focused on movement rather than absolute location.  Furthermore,
    the "enter" signal produces unexpected results when hovering,
    switching to a new folder, hovering over another folder and
    unexpectedly switching again (this doesn't happen with the "motion"
    signal).  Stop listening to the "enter" signal.

 src/nautilus-list-base.c | 17 -----------------
 1 file changed, 17 deletions(-)
---
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index c48712682..ac45e6655 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -561,22 +561,6 @@ hover_timer (gpointer user_data)
     return G_SOURCE_REMOVE;
 }
 
-static void
-on_item_drag_hover_enter (GtkDropControllerMotion *controller,
-                          gdouble                  x,
-                          gdouble                  y,
-                          gpointer                 user_data)
-{
-    NautilusViewCell *cell = user_data;
-    NautilusListBase *self = nautilus_view_cell_get_view (cell);
-    NautilusListBasePrivate *priv = nautilus_list_base_get_instance_private (self);
-
-    if (priv->hover_timer_id == 0)
-    {
-        priv->hover_timer_id = g_timeout_add (HOVER_TIMEOUT, hover_timer, cell);
-    }
-}
-
 static void
 on_item_drag_hover_leave (GtkDropControllerMotion *controller,
                           gpointer                 user_data)
@@ -905,7 +889,6 @@ setup_cell_common (GtkListItem      *listitem,
 
     controller = gtk_drop_controller_motion_new ();
     gtk_widget_add_controller (GTK_WIDGET (cell), controller);
-    g_signal_connect (controller, "enter", G_CALLBACK (on_item_drag_hover_enter), cell);
     g_signal_connect (controller, "leave", G_CALLBACK (on_item_drag_hover_leave), cell);
     g_signal_connect (controller, "motion", G_CALLBACK (on_item_drag_hover_motion), cell);
 }


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