From 3398f3acdfcbb727db12abac30b4f09629edef1d Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 3 Sep 2012 20:06:27 -0300 Subject: [PATCH] stage: Normalize key focus setting We often mean that when key_focus == NULL, it's assumed to be on the stage, and clutter_stage_get_key_focus() reflects this. We also do a lot of check around the lines of key_focus == NULL instead of also checking for the stage, so make sure to normalize it so that explicitly grabbing the stage's key focus will not change our behaviour. https://bugzilla.gnome.org/show_bug.cgi?id=683301 --- clutter/clutter-stage.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 7862edfb6..b85506f4a 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -3039,6 +3039,10 @@ clutter_stage_set_key_focus (ClutterStage *stage, priv = stage->priv; + /* normalize the key focus. NULL == stage */ + if (actor == CLUTTER_ACTOR (stage)) + actor = NULL; + /* avoid emitting signals and notifications if we're setting the same * actor as the key focus */