changeset 17487:4b711c5c2db8

Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
author Sean Egan <seanegan@gmail.com>
date Thu, 31 May 2007 00:47:24 +0000
parents ec8a4b674d50
children 45178b7e580d
files pidgin/gtkblist.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Wed May 30 22:47:51 2007 +0000
+++ b/pidgin/gtkblist.c	Thu May 31 00:47:24 2007 +0000
@@ -2721,6 +2721,7 @@
 {
 	GtkTreePath *path;
 	int delay;
+	GdkRectangle rect;
 
 	/*
 	 * When dragging a buddy into a contact, this is the delay before
@@ -2736,7 +2737,17 @@
 	}
 
 	gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), x, y, &path, NULL, NULL, NULL);
-	gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), path, NULL, &gtkblist->tip_rect);
+	gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), path, NULL, &rect);
+
+	/* Only autoexpand when in the middle of the cell to avoid annoying un-intended expands */
+	if (y < rect.y + (rect.height / 3) ||
+	    y > rect.y + (2 * (rect.height /3)))
+		return FALSE;
+	
+	rect.height = rect.height / 3;
+	rect.y += rect.height;
+
+	gtkblist->tip_rect = rect;
 
 	if (path)
 		gtk_tree_path_free(path);