[evolution-patches] Re: patch about gtkhtml, fix #70085 (new patch attached)



hi, rodo

Thanks a lot about your review.
here is the new patch against #70085. This time I use
html_engine_get_focus_object.

Will you please review it again? 

Many thanks.


Yours 
Mengjie Yu


On Tue, 2004-12-14 at 10:08, Radek Doulik wrote:
> Hi Mengjie,
> 
> please use 
>     HTMLObject * html_engine_get_focus_object (HTMLEngine *e, gint *offset)
> function to avoid code duplication.
> 
> Cheers
> Radek
> 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2063
diff -u -p -r1.2063 ChangeLog
--- ChangeLog	15 Dec 2004 09:30:39 -0000	1.2063
+++ ChangeLog	15 Dec 2004 09:51:21 -0000
@@ -1,3 +1,9 @@
+2004-12-15  Mengjie Yu  <meng-jie yu sun com>
+
+	* gtkhtml.c: (key_press_event):
+	fix #70085 the focus object may be a frame or an iframe, if so, 
+		   we must check its focus object recursively.
+
 2004-12-14  Mengjie Yu  <meng-jie yu sun com>
 
 	* gtkhtml.c: (focus), (gtk_html_class_init), (cursor_move):
Index: gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.584
diff -u -p -r1.584 gtkhtml.c
--- gtkhtml.c	15 Dec 2004 09:30:39 -0000	1.584
+++ gtkhtml.c	15 Dec 2004 09:51:28 -0000
@@ -869,6 +869,8 @@ key_press_event (GtkWidget *widget, GdkE
 	GtkHTML *html = GTK_HTML (widget);
 	GtkHTMLClass *html_class = GTK_HTML_CLASS (GTK_WIDGET_GET_CLASS (html));
 	gboolean retval, update = TRUE;
+	HTMLObject *focus_object;
+	gint focus_object_offset;
 
 	html->binding_handled = FALSE;
 	html->priv->update_styles = FALSE;
@@ -901,9 +903,12 @@ key_press_event (GtkWidget *widget, GdkE
 		switch (event->keyval) {
 		case GDK_Return:
 		case GDK_KP_Enter:
-			if (html->engine->focus_object) {
+			/* the toplevel gtkhtml's focus object may be a frame or ifame */
+			focus_object = html_engine_get_focus_object (html->engine, &focus_object_offset);
+					
+			if (focus_object) {
 				gchar *url;
-				url = html_object_get_complete_url (html->engine->focus_object, html->engine->focus_object_offset);
+				url = html_object_get_complete_url (focus_object, focus_object_offset);
 				if (url) {
 					/* printf ("link clicked: %s\n", url); */
 					g_signal_emit (html, signals [LINK_CLICKED], 0, url);


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