[clutter] stage: Normalize key focus setting
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [clutter] stage: Normalize key focus setting
- Date: Wed,  5 Sep 2012 17:17:07 +0000 (UTC)
commit 3398f3acdfcbb727db12abac30b4f09629edef1d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Sep 3 20:06:27 2012 -0300
    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 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index 7862edf..b85506f 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
    */
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]