From 8157bd8886436bbea619049c3caf355a641e9a91 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 7 Mar 2011 10:41:43 -0500 Subject: Bug 644066 - Text selection is cleared when right-clicking on a link --- widgets/misc/e-web-view.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index 7b46a63297..b4bb4b5019 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -431,12 +431,16 @@ web_view_button_press_event_cb (EWebView *web_view, GtkHTML *frame) { gboolean event_handled = FALSE; - gchar *uri; + gchar *uri = NULL; if (event != NULL && event->button != 3) return FALSE; - uri = e_web_view_extract_uri (web_view, event, frame); + /* Only extract a URI if no selection is active. Selected text + * implies the user is more likely to want to copy the selection + * to the clipboard than open a link within the selection. */ + if (!e_web_view_is_selection_active (web_view)) + uri = e_web_view_extract_uri (web_view, event, frame); if (uri != NULL && g_str_has_prefix (uri, "##")) { g_free (uri); @@ -935,9 +939,6 @@ web_view_popup_event (EWebView *web_view, GdkEventButton *event, const gchar *uri) { - if (uri != NULL) - e_web_view_unselect_all (web_view); - e_web_view_set_selected_uri (web_view, uri); e_web_view_show_popup_menu (web_view, event, NULL, NULL); -- cgit v1.2.3