[gtk/dnd-gestures-2: 133/150] filechooser: Suppress drag highlighting



commit 439b3adaf5266d131b02d3f245168df8d4481035
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 7 00:08:05 2020 -0500

    filechooser: Suppress drag highlighting

 gtk/gtkfilechooserwidget.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 3bba277ffc..35f60b2d63 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -2042,6 +2042,16 @@ file_list_drag_drop_cb (GtkDropTarget        *dest,
   return TRUE;
 }
 
+static void
+file_list_armed_cb (GtkDropTarget        *dest,
+                    GParamSpec           *pspec,
+                    GtkFileChooserWidget *impl)
+{
+  GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl);
+
+  gtk_drag_unhighlight (GTK_WIDGET (priv->browse_files_tree_view));
+}
+
 static void
 file_list_drag_begin_cb (GtkDragSource        *source,
                          GdkDrag              *drag,
@@ -8524,6 +8534,7 @@ post_process_ui (GtkFileChooserWidget *impl)
   dest = gtk_drop_target_new (formats, GDK_ACTION_COPY | GDK_ACTION_MOVE);
   g_signal_connect (dest, "drag-motion", G_CALLBACK (file_list_drag_motion_cb), impl);
   g_signal_connect (dest, "drag-drop", G_CALLBACK (file_list_drag_drop_cb), impl);
+  g_signal_connect (dest, "notify::armed", G_CALLBACK (file_list_armed_cb), impl);
   gtk_widget_add_controller (priv->browse_files_tree_view, GTK_EVENT_CONTROLLER (dest));
   gdk_content_formats_unref (formats);
 


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