St: don't attempt to give focus to non reactive actors

Non reactive actors don't expect to be interacted with, and thus
should not get keyboard focus.

https://bugzilla.gnome.org/show_bug.cgi?id=619955
This commit is contained in:
Giovanni Campagna
2012-07-18 12:19:55 +02:00
parent a29507e452
commit 26d3b1929e
5 changed files with 8 additions and 9 deletions

View File

@ -195,7 +195,8 @@ st_bin_navigate_focus (StWidget *widget,
StBinPrivate *priv = ST_BIN (widget)->priv;
ClutterActor *bin_actor = CLUTTER_ACTOR (widget);
if (st_widget_get_can_focus (widget))
if (clutter_actor_get_reactive (bin_actor) &&
st_widget_get_can_focus (widget))
{
if (from && clutter_actor_contains (bin_actor, from))
return FALSE;

View File

@ -285,7 +285,8 @@ st_entry_navigate_focus (StWidget *widget,
if (from == priv->entry)
return FALSE;
else if (st_widget_get_can_focus (widget))
else if (clutter_actor_get_reactive (CLUTTER_ACTOR (widget)) &&
st_widget_get_can_focus (widget))
{
clutter_actor_grab_key_focus (priv->entry);
return TRUE;

View File

@ -1880,7 +1880,8 @@ st_widget_real_navigate_focus (StWidget *widget,
while (focus_child && clutter_actor_get_parent (focus_child) != widget_actor)
focus_child = clutter_actor_get_parent (focus_child);
if (widget->priv->can_focus)
if (clutter_actor_get_reactive (widget_actor) &&
widget->priv->can_focus)
{
if (!focus_child)
{