From def14e80cbb898c6c198a5caf3a2a3ad15d5e8e1 Mon Sep 17 00:00:00 2001 From: Mike Owens Date: Thu, 9 Dec 2010 09:39:23 -0500 Subject: [PATCH] ClutterText: Only grab keyboard focus if keyboard-interactive. Previously, ClutterText took keyboard focus on mouse-down, regardless if it were editable or selectable. Now it checks these properties, and behaves like other actors if it can't do anything useful with the focus. http://bugzilla.clutter-project.org/show_bug.cgi?id=2462 --- clutter/clutter-text.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index e18d9f974..9d41b9b6c 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -1649,8 +1649,9 @@ clutter_text_button_press (ClutterActor *actor, gfloat x, y; gint index_; - /* we'll steal keyfocus if we do not have it */ - clutter_actor_grab_key_focus (actor); + /* we'll steal keyfocus if we need it */ + if (priv->editable || priv->selectable) + clutter_actor_grab_key_focus (actor); /* if the actor is empty we just reset everything and not * set up the dragging of the selection since there's nothing