[evolution-patches] patch about gtkhtml, fix #70085



Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2062
diff -u -p -r1.2062 ChangeLog
--- ChangeLog	6 Dec 2004 16:41:35 -0000	1.2062
+++ ChangeLog	14 Dec 2004 06:38:34 -0000
@@ -1,3 +1,9 @@
+2004-12-14  Mengjie Yu  <meng-jie yu sun com>
+
+	* gtkhtml.c: (key_press_event):
+	fix #70085 he focus object may be a frame or an iframe, if so, 
+		   we must check its focus object recursively.
+
 2004-09-29  Radek Doulik  <rodo ximian com>
 
 	* gtkhtml.c (drag_data_received): call gdk_window_get_pointer so
Index: gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.583
diff -u -p -r1.583 gtkhtml.c
--- gtkhtml.c	6 Dec 2004 16:41:35 -0000	1.583
+++ gtkhtml.c	14 Dec 2004 06:38:47 -0000
@@ -866,6 +866,7 @@ 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;
+	HTMLEngine *e;
 
 	html->binding_handled = FALSE;
 	html->priv->update_styles = FALSE;
@@ -898,9 +899,14 @@ key_press_event (GtkWidget *widget, GdkE
 		switch (event->keyval) {
 		case GDK_Return:
 		case GDK_KP_Enter:
-			if (html->engine->focus_object) {
+			e = html->engine;
+			/* the toplevel gtkhtml's focus object may be a frame or ifame */
+			while (html_object_is_frame (e->focus_object)) {
+				e = html_object_get_engine (e->focus_object, e);
+			}
+			if (e->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 (e->focus_object, e->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]