Fix ExportFormatSpecification copy-c'tor
[ardour.git] / patches / gtkdnd-quartz.patch
1 --- old/gtk+-2.24.23/gtk/gtkdnd-quartz.c        2013-10-16 11:29:55.000000000 -0400
2 +++ new/gtk+-2.24.23/gtk/gtkdnd-quartz.c        2015-07-20 14:53:33.000000000 -0400
3 @@ -1928,16 +1928,29 @@
4  static gboolean
5  drag_drop_finished_idle_cb (gpointer data)
6  {
7 -  gtk_drag_source_info_destroy (data);
8 +  GtkDragSourceInfo* info = (GtkDragSourceInfo*) data;
9 +  if (info->success) 
10 +    {
11 +       gtk_drag_source_info_destroy (data);
12 +    }
13    return FALSE;
14  }
15  
16  static void
17 -gtk_drag_drop_finished (GtkDragSourceInfo *info)
18 +gtk_drag_drop_finished (GtkDragSourceInfo *info, GtkDragResult result)
19  {
20 -  if (info->success && info->delete)
21 -    g_signal_emit_by_name (info->source_widget, "drag-data-delete",
22 -                           info->context);
23 +        gboolean success = (result == GTK_DRAG_RESULT_SUCCESS);
24 +
25 +        if (!success) {
26 +                g_signal_emit_by_name (info->source_widget, "drag-failed",
27 +                                       info->context, GTK_DRAG_RESULT_NO_TARGET, &success);
28 +        }
29 +                
30 +        if (success && info->delete) {
31 +                g_signal_emit_by_name (info->source_widget, "drag-data-delete",
32 +                                       info->context);
33 +        }
34 +
35  
36    /* Workaround for the fact that the NS API blocks until the drag is
37     * over. This way the context is still valid when returning from
38 @@ -1963,6 +1976,7 @@
39  {
40    GtkDragSourceInfo *info;
41    GdkDragContext *context;
42 +  GtkDragResult result;
43  
44    g_return_if_fail (widget != NULL);
45    g_return_if_fail (event != NULL);
46 @@ -1975,7 +1989,8 @@
47    switch (event->type)
48      {
49      case GDK_DROP_FINISHED:
50 -      gtk_drag_drop_finished (info);
51 +      result = (gdk_drag_context_get_dest_window (context) != NULL) ? GTK_DRAG_RESULT_SUCCESS : GTK_DRAG_RESULT_NO_TARGET;
52 +      gtk_drag_drop_finished (info, result);
53        break;
54      default:
55        g_assert_not_reached ();