aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaun McCance <Shaun McCance>2009-10-06 03:48:24 +0800
committerShaun McCance <shaunm@gnome.org>2009-11-25 05:15:30 +0800
commit43390cb381e1dd4b68771c3c285bc1f5326a5b74 (patch)
tree5a28fdd2df9ad3fdb501ec508babb54e783ee665
parentf167ec2d92a526d19f1faf8320d9ff975ae1e502 (diff)
downloadgsoc2013-empathy-43390cb381e1dd4b68771c3c285bc1f5326a5b74.tar
gsoc2013-empathy-43390cb381e1dd4b68771c3c285bc1f5326a5b74.tar.gz
gsoc2013-empathy-43390cb381e1dd4b68771c3c285bc1f5326a5b74.tar.bz2
gsoc2013-empathy-43390cb381e1dd4b68771c3c285bc1f5326a5b74.tar.lz
gsoc2013-empathy-43390cb381e1dd4b68771c3c285bc1f5326a5b74.tar.xz
gsoc2013-empathy-43390cb381e1dd4b68771c3c285bc1f5326a5b74.tar.zst
gsoc2013-empathy-43390cb381e1dd4b68771c3c285bc1f5326a5b74.zip
Fixed leak in drag motion and added comments for bug #595226
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 3e1464654..0dc5cba14 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -453,7 +453,10 @@ contact_list_view_drag_motion (GtkWidget *widget,
}
if (path == NULL) {
- gdk_drag_status (context, 0, time_);
+ /* Coordinates don't point to an actual row, so make sure the pointer
+ and highlighting don't indicate that a drag is possible.
+ */
+ gdk_drag_status (context, GDK_ACTION_DEFAULT, time_);
gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget), NULL, 0);
return FALSE;
}
@@ -461,6 +464,13 @@ contact_list_view_drag_motion (GtkWidget *widget,
gtk_tree_model_get_iter (model, &iter, path);
if (target == GDK_NONE) {
+ /* If target == GDK_NONE, then we don't have a target that can be
+ dropped on a contact. This means a contact drag. If we're
+ pointing to a group, highlight it. Otherwise, if the contact
+ we're pointing to is in a group, highlight that. Otherwise,
+ set the drag position to before the first row for a drag into
+ the "non-group" at the top.
+ */
GtkTreeIter group_iter;
gboolean is_group;
GtkTreePath *group_path;
@@ -493,6 +503,9 @@ contact_list_view_drag_motion (GtkWidget *widget,
}
}
else {
+ /* This is a file drag, and it can only be dropped on contacts,
+ not groups.
+ */
EmpathyContact *contact;
gtk_tree_model_get (model, &iter,
EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact,
@@ -502,6 +515,7 @@ contact_list_view_drag_motion (GtkWidget *widget,
gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget),
path,
GTK_TREE_VIEW_DROP_INTO_OR_BEFORE);
+ g_object_unref (contact);
}
else {
gdk_drag_status (context, 0, time_);