summary refs log tree commit diff stats
path: root/src/fe-gtk/urlgrab.c
diff options
context:
space:
mode:
authorTingPing <tngpng@gmail.com>2013-06-18 15:08:56 -0700
committerTingPing <tngpng@gmail.com>2013-06-18 15:08:56 -0700
commit225acd0ce2135e6cce18b3f1d6abc32b3922d033 (patch)
treefd7de1c1f965c5c203fd40496e45bdb56bffdf6e /src/fe-gtk/urlgrab.c
parent52ce55341b7fb249376c27194ae56ee8aeb40141 (diff)
parentb4496216db9d5244284b36cdc1d8351901736b41 (diff)
Merge pull request #649 from RichardHitt/urlgrabber
Fix urlgrabber right click selection.
Diffstat (limited to 'src/fe-gtk/urlgrab.c')
-rw-r--r--src/fe-gtk/urlgrab.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/fe-gtk/urlgrab.c b/src/fe-gtk/urlgrab.c
index be62239e..c28a3321 100644
--- a/src/fe-gtk/urlgrab.c
+++ b/src/fe-gtk/urlgrab.c
@@ -49,13 +49,22 @@ url_treeview_url_clicked_cb (GtkWidget *view, GdkEventButton *event,
 {
 	GtkTreeIter iter;
 	gchar *url;
+	GtkTreeSelection *sel;
+	GtkTreePath *path;
+	GtkTreeView *tree = GTK_TREE_VIEW (view);
 
-	if (!event ||
-	    !gtkutil_treeview_get_selected (GTK_TREE_VIEW (view), &iter,
+   if (!event || !gtk_tree_view_get_path_at_pos (tree, event->x, event->y, &path, 0, 0, 0))
+      return FALSE;
+
+   /* select what they right-clicked on */
+   sel = gtk_tree_view_get_selection (tree); 
+   gtk_tree_selection_unselect_all (sel);
+   gtk_tree_selection_select_path (sel, path);
+   gtk_tree_path_free (path); 
+
+	if (!gtkutil_treeview_get_selected (GTK_TREE_VIEW (view), &iter,
 	                                    URL_COLUMN, &url, -1))
-	{
 		return FALSE;
-	}
 	
 	switch (event->button)
 	{