[empathy: 1/4] chat_window_drag_motion : search in all the drop targets



commit f0555970a6dd57a4494c295f1e29e42d8aafec2d
Author: Olivier Le Thanh Duong <olivier lethanh be>
Date:   Thu Mar 4 22:57:43 2010 +0100

    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 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 2e2f5c0..8a5d503 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



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