From f0555970a6dd57a4494c295f1e29e42d8aafec2d Mon Sep 17 00:00:00 2001 From: Olivier Le Thanh Duong Date: Thu, 4 Mar 2010 22:57:43 +0100 Subject: chat_window_drag_motion : search in all the drop targets Use gtk_drag_dest_find_target to search in all the drop targets instead of only the first one. --- src/empathy-chat-window.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 2e2f5c003..8a5d50356 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -1563,14 +1563,11 @@ chat_window_drag_motion (GtkWidget *widget, { GdkAtom target; EmpathyChatWindowPriv *priv; - GdkAtom dest_target; priv = GET_PRIV (window); - target = gtk_drag_dest_find_target (widget, context, NULL); - - dest_target = gdk_atom_intern_static_string ("text/uri-list"); - if (target == dest_target) { + target = gtk_drag_dest_find_target (widget, context, priv->file_targets); + if (target != GDK_NONE) { /* This is a file drag. Ensure the contact is online and set the drag type to COPY. Note that it's possible that the tab will be switched by GTK+ after a timeout from drag_motion without @@ -1599,8 +1596,8 @@ chat_window_drag_motion (GtkWidget *widget, return TRUE; } - dest_target = gdk_atom_intern_static_string ("text/contact-id"); - if (target == dest_target) { + target = gtk_drag_dest_find_target (widget, context, priv->contact_targets); + if (target != GDK_NONE) { /* This is a drag of a contact from a contact list. Set to COPY. FIXME: If this drag is to a MUC window, it invites the user. Otherwise, it opens a chat. Should we use a different drag -- cgit v1.2.3