[gtkhtml] Bug 604561 - Copy popup action shown with no text selected



commit e7264f8b2c64ae29e7a1124fe30991648e052ecb
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 11 09:17:53 2010 -0500

    Bug 604561 - Copy popup action shown with no text selected

 gtkhtml/htmlselection.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtkhtml/htmlselection.c b/gtkhtml/htmlselection.c
index d4844af..c7e6e0b 100644
--- a/gtkhtml/htmlselection.c
+++ b/gtkhtml/htmlselection.c
@@ -140,9 +140,13 @@ html_engine_select_interval (HTMLEngine *e, HTMLInterval *i)
 {
 	e = html_engine_get_top_html_engine (e);
 	html_engine_hide_cursor (e);
-	if (e->selection && html_interval_eq (e->selection, i))
+	if (e->selection && html_interval_eq (e->selection, i)) {
 		html_interval_destroy (i);
-	else {
+	} else if (i && i->from.object == i->to.object && i->from.offset == i->to.offset) {
+		/* shouldn't select zero letters */
+		html_interval_destroy (i);
+		html_engine_unselect_all (e);
+	} else {
 		if (!e->selection || !optimize_selection (e, i)) {
 			html_engine_unselect_all (e);
 			e->selection = i;



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