Allow for object being NULL which means the window containing the focus
authorPadraig O'Briain <padraigo@src.gnome.org>
Fri, 26 Apr 2002 14:39:53 +0000 (14:39 +0000)
committerPadraig O'Briain <padraigo@src.gnome.org>
Fri, 26 Apr 2002 14:39:53 +0000 (14:39 +0000)
* atk/atkutil.c (atk_focus_tracker_notify):
Allow for object being NULL which means the window containing the
focus widget has lost focus. We update the previous_focus_object
so we can emit notification for focus widget when window regains
focus.

ChangeLog
atk/atkutil.c

index 2ac2cf9..6d5bb28 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2002-04-26  Padraig O'Briain  <padraig.obriain@sun.com>
+
+       * atk/atkutil.c (atk_focus_tracker_notify):
+       Allow for object being NULL which means the window containing the
+       focus widget has lost focus. We update the previous_focus_object 
+       so we can emit notification for focus widget when window regains
+       focus.
+
 2002-04-15  Padraig O'Briain  <padraig.obriain@sun.com>
 
        * atk/atkgobjectaccessible.c:
index 459a820..7089782 100755 (executable)
@@ -186,15 +186,21 @@ atk_focus_tracker_notify (AtkObject       *object)
     {
       if (previous_focus_object)
         g_object_unref (previous_focus_object);
-      previous_focus_object = g_object_ref (object);
+
+      previous_focus_object = object;
+      if (object)
+        {
+          g_object_ref (object);
+
+          for (i = 0; i < trackers->len; i++)
+            {
+              item = &g_array_index (trackers, FocusTracker, i);
+              g_return_if_fail (item != NULL);
+              item->func (object);
+            }
+        }
+    
     }
-  
-  for (i = 0; i < trackers->len; i++)
-  {
-    item = &g_array_index (trackers, FocusTracker, i);
-    g_return_if_fail (item != NULL);
-    item->func (object);
-  }
 }
 
 /**