[evolution-patches] A patch for gtkhtml's key_press_event handling



Radek,
I found gtkhtml's key_press_event was not returning the correct value when I was debuging. It should return TRUE for handled key press and return FALSE for unhandled key press. After some debugging, I found there were several problems and made the attached patch. Please review it. And since I will take vacation for about a week from tomorrow, please help me to modify and commit the patch into HEAD. I cannot do this at my home.
   Thanks!
      Harry
Index: gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.588
diff -u -r1.588 gtkhtml.c
--- gtkhtml.c	31 Jan 2005 11:20:42 -0000	1.588
+++ gtkhtml.c	8 Feb 2005 04:59:27 -0000
@@ -868,7 +868,7 @@
 {
 	GtkHTML *html = GTK_HTML (widget);
 	GtkHTMLClass *html_class = GTK_HTML_CLASS (GTK_WIDGET_GET_CLASS (html));
-	gboolean retval, update = TRUE;
+	gboolean retval = FALSE, update = TRUE;
 	HTMLObject *focus_object;
 	gint focus_object_offset;
 
@@ -888,9 +888,9 @@
 		gtk_binding_set_activate (html_class->emacs_bindings, event->keyval, event->state, GTK_OBJECT (widget));
 
 	if (!html->binding_handled)
-		GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
+		retval = GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
 
-	retval = html->binding_handled;
+	retval = retval || html->binding_handled;
 	update = html->priv->update_styles;
 
 	if (retval && update)
@@ -2885,8 +2885,8 @@
 			      G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 			      G_STRUCT_OFFSET (GtkHTMLClass, command),
 			      NULL, NULL,
-			      g_cclosure_marshal_VOID__ENUM,
-			      G_TYPE_NONE, 1, GTK_TYPE_HTML_COMMAND);
+			      html_g_cclosure_marshal_BOOL__ENUM,
+			      G_TYPE_BOOLEAN, 1, GTK_TYPE_HTML_COMMAND);
 
 	signals [CURSOR_CHANGED] = 
 		g_signal_new ("cursor_changed",
@@ -4615,6 +4615,7 @@
 		break;
 
 	default:
+		rv = FALSE;
 		html->binding_handled = FALSE;
 	}
 
Index: htmlclosures.list
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlclosures.list,v
retrieving revision 1.3
diff -u -r1.3 htmlclosures.list
--- htmlclosures.list	7 Jan 2004 18:34:26 -0000	1.3
+++ htmlclosures.list	8 Feb 2005 04:59:27 -0000
@@ -1,4 +1,5 @@
 BOOL:OBJECT
+BOOL:ENUM
 VOID:STRING,POINTER
 VOID:POINTER,INT
 VOID:STRING,STRING,STRING
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2088
diff -u -r1.2088 ChangeLog
--- ChangeLog	7 Feb 2005 16:04:19 -0000	1.2088
+++ ChangeLog	8 Feb 2005 05:01:17 -0000
@@ -1,3 +1,10 @@
+2005-02-08  Harry Lu <harry lu sun com>
+
+	* gtkhtml.c: (key_press_event): return correct value.
+	 (gtk_html_class_init): define "command" signal correctly.
+	 (command): return correct value.
+	* htmlclosures.list: add a marshal.
+
 2005-02-07  Radek Doulik  <rodo novell com>
 
 	* htmlclueflow.c (draw_item): fixed RTL rendering


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