[evolution] Bug 644066 - Text selection is cleared when right-clicking on a link



commit 8157bd8886436bbea619049c3caf355a641e9a91
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Mar 7 10:41:43 2011 -0500

    Bug 644066 - Text selection is cleared when right-clicking on a link

 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 7b46a63..b4bb4b5 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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]