From a362a4a8894e0630af54acc43be05a928306278e Mon Sep 17 00:00:00 2001 From: Raymond Liu Date: Mon, 30 Mar 2009 16:57:11 +0100 Subject: [PATCH] [text] Use the base class binding pool Bug 1518 - [Patch] Widget derivied from ClutterText will crash on key_press_event In clutter_text_key_press() we are using G_OBJECT_TYPE_NAME to find out the actor's type name. However, if some widget is derived from ClutterText, when the key press handler is called, G_OBJECT_TYPE_NAME will return the name of the derived widget. The default implementation should get the binding pool for the base class. Signed-off-by: Emmanuele Bassi --- clutter/clutter-text.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index 0cc27cb71..af79ac110 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -1174,7 +1174,11 @@ clutter_text_key_press (ClutterActor *actor, keyval = clutter_key_event_symbol (event); - pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (actor)); + /* we need to use the ClutterText type name to find our own + * key bindings; subclasses will override or chain up this + * event handler, so they can do whatever they want there + */ + pool = clutter_binding_pool_find (g_type_name (CLUTTER_TYPE_TEXT)); g_assert (pool != NULL); /* we allow passing synthetic events that only contain