[cairo-commit] goocanvas/src goocanvas.c,1.16,1.17

Damon Chaplin commit at pdx.freedesktop.org
Thu Apr 5 04:28:48 PDT 2007


Committed by: damon

Update of /cvs/cairo/goocanvas/src
In directory kemper:/tmp/cvs-serv26620/src

Modified Files:
	goocanvas.c 
Log Message:
2007-04-05  Damon Chaplin  <damon at gnome.org>

	* src/goocanvas.c (goo_canvas_key_press, goo_canvas_key_release): only
	emit "key-press" and "key-release" signals on items if the canvas has
	the focus. (We were incorrectly emitting signals if an embedded widget
	had the focus, as the events were propagating up to the canvas.)



Index: goocanvas.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvas.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- goocanvas.c	27 Mar 2007 11:40:56 -0000	1.16
+++ goocanvas.c	5 Apr 2007 11:28:40 -0000	1.17
@@ -2511,7 +2511,7 @@
 {
   GooCanvas *canvas = GOO_CANVAS (widget);
 	
-  if (canvas->focused_item)
+  if (GTK_WIDGET_HAS_FOCUS (canvas) && canvas->focused_item)
     if (propagate_event (canvas, canvas->focused_item, "key_press_event",
 			 (GdkEvent*) event))
     return TRUE;
@@ -2526,7 +2526,7 @@
 {
   GooCanvas *canvas = GOO_CANVAS (widget);
 	
-  if (canvas->focused_item)
+  if (GTK_WIDGET_HAS_FOCUS (canvas) && canvas->focused_item)
     if (propagate_event (canvas, canvas->focused_item, "key_release_event",
 			 (GdkEvent*) event))
     return TRUE;



More information about the cairo-commit mailing list