Magellan Linux

Contents of /trunk/gtk2+/patches/gtk2+-2.10.11-mozilla-dnd-fix.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 144 - (show annotations) (download)
Tue May 8 20:06:05 2007 UTC (17 years, 5 months ago) by niro
File size: 2899 byte(s)
-import

1 This patch is applied upstream to fix http://bugzilla.gnome.org/show_bug.cgi?id=122688
2 As this regresses mozilla products drag-and-drop (bug 162362) we are reverse applying
3 it as what it fixed is a corner case while mozilla case is a big problem.
4 The real problem is inside mozilla code, see http://bugzilla.gnome.org/show_bug.cgi?id=394525
5 but we can't fix this for binary thunderbird/firefox/seamonkey packages
6
7 --- /branches/gtk-2-10/gtk/gtkdnd.c 2006/11/05 08:55:47 16711
8 +++ branches/gtk-2-10/gtk/gtkdnd.c 2006/11/06 17:16:37 16712
9 @@ -285,6 +285,9 @@
10 static gboolean gtk_drag_grab_broken_event_cb (GtkWidget *widget,
11 GdkEventGrabBroken *event,
12 gpointer data);
13 +static void gtk_drag_grab_notify_cb (GtkWidget *widget,
14 + gboolean was_grabbed,
15 + gpointer data);
16 static gboolean gtk_drag_button_release_cb (GtkWidget *widget,
17 GdkEventButton *event,
18 gpointer data);
19 @@ -2331,6 +2334,8 @@
20
21 g_signal_connect (info->ipc_widget, "grab_broken_event",
22 G_CALLBACK (gtk_drag_grab_broken_event_cb), info);
23 + g_signal_connect (info->ipc_widget, "grab_notify",
24 + G_CALLBACK (gtk_drag_grab_notify_cb), info);
25 g_signal_connect (info->ipc_widget, "button_release_event",
26 G_CALLBACK (gtk_drag_button_release_cb), info);
27 g_signal_connect (info->ipc_widget, "motion_notify_event",
28 @@ -3762,6 +3767,9 @@
29 gtk_drag_grab_broken_event_cb,
30 info);
31 g_signal_handlers_disconnect_by_func (info->ipc_widget,
32 + gtk_drag_grab_notify_cb,
33 + info);
34 + g_signal_handlers_disconnect_by_func (info->ipc_widget,
35 gtk_drag_button_release_cb,
36 info);
37 g_signal_handlers_disconnect_by_func (info->ipc_widget,
38 @@ -3926,6 +3934,9 @@
39 gtk_drag_grab_broken_event_cb,
40 info);
41 g_signal_handlers_disconnect_by_func (info->ipc_widget,
42 + gtk_drag_grab_notify_cb,
43 + info);
44 + g_signal_handlers_disconnect_by_func (info->ipc_widget,
45 gtk_drag_button_release_cb,
46 info);
47 g_signal_handlers_disconnect_by_func (info->ipc_widget,
48 @@ -4117,6 +4128,24 @@
49 return TRUE;
50 }
51
52 +static void
53 +gtk_drag_grab_notify_cb (GtkWidget *widget,
54 + gboolean was_grabbed,
55 + gpointer data)
56 +{
57 + GtkDragSourceInfo *info = (GtkDragSourceInfo *)data;
58 +
59 + if (!was_grabbed)
60 + {
61 + /* We have to block callbacks to avoid recursion here, because
62 + gtk_drag_cancel calls gtk_grab_remove (via gtk_drag_end) */
63 + g_signal_handlers_block_by_func (widget, gtk_drag_grab_notify_cb, data);
64 + gtk_drag_cancel (info, gtk_get_current_event_time ());
65 + g_signal_handlers_unblock_by_func (widget, gtk_drag_grab_notify_cb, data);
66 + }
67 +}
68 +
69 +
70 /*************************************************************
71 * gtk_drag_button_release_cb:
72 * "button_release_event" callback during drag.