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
This commit is contained in:
Mike Owens 2010-12-09 09:39:23 -05:00 committed by Emmanuele Bassi
parent 7b985f034f
commit def14e80cb

View File

@ -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