[gtk/dnd-gestures-2: 38/57] stackswitcher: Don't highlight on dnd



commit 64621df1f94acd8c9b9e0fbd9642306697eb7a1c
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jan 5 17:09:02 2020 -0500

    stackswitcher: Don't highlight on dnd
    
    We just want to let drags switch the active page,
    never actually accept a drop. So, don't highlight.

 gtk/gtkstackswitcher.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c
index 6780f25520..0ead3b12c7 100644
--- a/gtk/gtkstackswitcher.c
+++ b/gtk/gtkstackswitcher.c
@@ -98,7 +98,7 @@ static gboolean gtk_stack_switcher_drag_motion (GtkDropTarget    *dest,
                                                 int               x,
                                                 int               y,
                                                 GtkStackSwitcher *self);
-
+static void gtk_stack_switcher_armed (GtkStackSwitcher *self);
 
 G_DEFINE_TYPE_WITH_PRIVATE (GtkStackSwitcher, gtk_stack_switcher, GTK_TYPE_WIDGET)
 
@@ -121,6 +121,7 @@ gtk_stack_switcher_init (GtkStackSwitcher *switcher)
   gtk_drop_target_set_track_motion (dest, TRUE);
   g_signal_connect (dest, "drag-leave", G_CALLBACK (gtk_stack_switcher_drag_leave), switcher);
   g_signal_connect (dest, "drag-motion", G_CALLBACK (gtk_stack_switcher_drag_motion), switcher);
+  g_signal_connect_swapped (dest, "notify::armed", G_CALLBACK (gtk_stack_switcher_armed), switcher);
   gtk_drop_target_attach (dest, GTK_WIDGET (switcher));
 }
 
@@ -311,6 +312,12 @@ gtk_stack_switcher_drag_leave (GtkDropTarget    *dest,
   remove_switch_timer (self);
 }
 
+static void
+gtk_stack_switcher_armed (GtkStackSwitcher *self)
+{
+  gtk_drag_unhighlight (GTK_WIDGET (self));
+}
+
 static void
 add_child (guint             position,
            GtkStackSwitcher *self)


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