diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-03-07 23:41:43 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-03-07 23:41:43 +0800 |
commit | 8157bd8886436bbea619049c3caf355a641e9a91 (patch) | |
tree | f2e8c2f7c30b8ba55627631da5e0fdcc93c9d2df | |
parent | 972bddf8719ae4b11ced5a7034d5e1808c4ef9bd (diff) | |
download | gsoc2013-evolution-8157bd8886436bbea619049c3caf355a641e9a91.tar.gz gsoc2013-evolution-8157bd8886436bbea619049c3caf355a641e9a91.tar.zst gsoc2013-evolution-8157bd8886436bbea619049c3caf355a641e9a91.zip |
Bug 644066 - Text selection is cleared when right-clicking on a link
-rw-r--r-- | widgets/misc/e-web-view.c | 11 |
1 files changed, 6 insertions, 5 deletions
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); |