summaryrefslogtreecommitdiff
path: root/patches/gtkdnd-quartz.patch
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-07-20 16:55:51 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-07-20 16:56:15 -0400
commitcdedf7f617e76b024c384e6d842487e6d8f67f46 (patch)
tree0295757af2120c41f1eab32f3cc3d19ead2b2b51 /patches/gtkdnd-quartz.patch
parent7198908a00fa87b329035c6beebb81cfde719e41 (diff)
patches to fix notebook tab tearoff on DnD.
See also https://bugzilla.gnome.org/show_bug.cgi?id=752638 for updates on integration into GTK+ 2 and GTK+ 3
Diffstat (limited to 'patches/gtkdnd-quartz.patch')
-rw-r--r--patches/gtkdnd-quartz.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/patches/gtkdnd-quartz.patch b/patches/gtkdnd-quartz.patch
new file mode 100644
index 0000000000..07723ad533
--- /dev/null
+++ b/patches/gtkdnd-quartz.patch
@@ -0,0 +1,55 @@
+--- old/gtk+-2.24.23/gtk/gtkdnd-quartz.c 2013-10-16 11:29:55.000000000 -0400
++++ new/gtk+-2.24.23/gtk/gtkdnd-quartz.c 2015-07-20 14:53:33.000000000 -0400
+@@ -1928,16 +1928,29 @@
+ static gboolean
+ drag_drop_finished_idle_cb (gpointer data)
+ {
+- gtk_drag_source_info_destroy (data);
++ GtkDragSourceInfo* info = (GtkDragSourceInfo*) data;
++ if (info->success)
++ {
++ gtk_drag_source_info_destroy (data);
++ }
+ return FALSE;
+ }
+
+ static void
+-gtk_drag_drop_finished (GtkDragSourceInfo *info)
++gtk_drag_drop_finished (GtkDragSourceInfo *info, GtkDragResult result)
+ {
+- if (info->success && info->delete)
+- g_signal_emit_by_name (info->source_widget, "drag-data-delete",
+- info->context);
++ gboolean success = (result == GTK_DRAG_RESULT_SUCCESS);
++
++ if (!success) {
++ g_signal_emit_by_name (info->source_widget, "drag-failed",
++ info->context, GTK_DRAG_RESULT_NO_TARGET, &success);
++ }
++
++ if (success && info->delete) {
++ g_signal_emit_by_name (info->source_widget, "drag-data-delete",
++ info->context);
++ }
++
+
+ /* Workaround for the fact that the NS API blocks until the drag is
+ * over. This way the context is still valid when returning from
+@@ -1963,6 +1976,7 @@
+ {
+ GtkDragSourceInfo *info;
+ GdkDragContext *context;
++ GtkDragResult result;
+
+ g_return_if_fail (widget != NULL);
+ g_return_if_fail (event != NULL);
+@@ -1975,7 +1989,8 @@
+ switch (event->type)
+ {
+ case GDK_DROP_FINISHED:
+- gtk_drag_drop_finished (info);
++ result = (gdk_drag_context_get_dest_window (context) != NULL) ? GTK_DRAG_RESULT_SUCCESS : GTK_DRAG_RESULT_NO_TARGET;
++ gtk_drag_drop_finished (info, result);
+ break;
+ default:
+ g_assert_not_reached ();