summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fe-gtk/fe-gtk.c24
-rw-r--r--src/fe-gtk/urlgrab.c17
-rw-r--r--src/fe-gtk/xtext.c12
3 files changed, 43 insertions, 10 deletions
diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c
index e3b4ec80..6890286f 100644
--- a/src/fe-gtk/fe-gtk.c
+++ b/src/fe-gtk/fe-gtk.c
@@ -1009,21 +1009,33 @@ static void
 fe_open_url_locale (const char *url)
 {
 	int url_type = url_check_word (url);
+	char *uri;
 
+	/* gvfs likes file:// */
+	if (url_type == WORD_PATH)
+	{
+#ifndef WIN32
+		uri = g_strconcat ("file://", url, NULL);
+		fe_open_url_inner (uri);
+		g_free (uri);
+#else
+		fe_open_url_inner (url);
+#endif
+	}
 	/* IPv6 addr. Add http:// */
-	if (url_type == WORD_HOST6)
+	else if (url_type == WORD_HOST6)
 	{
 		/* IPv6 addrs in urls should be enclosed in [ ] */
 		if (*url != '[')
-			url = g_strdup_printf ("http://[%s]", url);
+			uri = g_strdup_printf ("http://[%s]", url);
 		else
-			url = g_strdup_printf ("http://%s", url);
+			uri = g_strdup_printf ("http://%s", url);
 
-		fe_open_url_inner (url);
-		g_free ((char *)url);
+		fe_open_url_inner (uri);
+		g_free (uri);
 	}
 	/* the http:// part's missing, prepend it, otherwise it won't always work */
-	else if (strchr (url, ':') == NULL && url_type != WORD_PATH)
+	else if (strchr (url, ':') == NULL)
 	{
 		url = g_strdup_printf ("http://%s", url);
 		fe_open_url_inner (url);
diff --git a/src/fe-gtk/urlgrab.c b/src/fe-gtk/urlgrab.c
index be62239e..cefa51c8 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)
 	{
diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c
index 41fb9fdd..7867342f 100644
--- a/src/fe-gtk/xtext.c
+++ b/src/fe-gtk/xtext.c
@@ -1780,6 +1780,12 @@ gtk_xtext_scrolldown_timeout (GtkXText * xtext)
 	GtkAdjustment *adj = xtext->adj;
 	textentry *ent;
 
+	if (buf->last_ent_end == NULL)	/* If context has changed */
+	{
+		xtext->scroll_tag = 0;
+		return 0;
+	}
+
 	gdk_window_get_pointer (GTK_WIDGET (xtext)->window, 0, &p_y, 0);
 	gdk_drawable_get_size (GTK_WIDGET (xtext)->window, 0, &win_height);
 
@@ -1821,6 +1827,12 @@ gtk_xtext_scrollup_timeout (GtkXText * xtext)
 	GtkAdjustment *adj = xtext->adj;
 	textentry *ent;
 
+	if (buf->last_ent_start == NULL)	/* If context has changed */
+	{
+		xtext->scroll_tag = 0;
+		return 0;
+	}
+
 	gdk_window_get_pointer (GTK_WIDGET (xtext)->window, 0, &p_y, 0);
 
 	if (p_y < 0 && adj->value >= 0)