Relinquish the focus when unmapped while owning it

Bug 1547 - when an actor is unmapped while owning the focus, it should
           release it

When an actor is unmapped while owning the focus, the should release it.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
Johan Bilien 2009-04-08 10:33:39 +01:00 committed by Emmanuele Bassi
parent 125bded814
commit 51f4e9680b

View File

@ -869,6 +869,20 @@ clutter_actor_real_unmap (ClutterActor *self)
*/
g_object_notify (G_OBJECT (self), "mapped");
/* relinquish keyboard focus if we were unmapped while owning it */
if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL))
{
ClutterActor *stage;
stage = clutter_actor_get_stage (self);
if (stage &&
clutter_stage_get_key_focus (CLUTTER_STAGE (stage)) == self)
{
clutter_stage_set_key_focus (CLUTTER_STAGE (stage), NULL);
}
}
clutter_actor_queue_redraw (self);
}