diff options
author | Padraig O'Briain <padraigo@src.gnome.org> | 2002-04-26 14:39:53 +0000 |
---|---|---|
committer | Padraig O'Briain <padraigo@src.gnome.org> | 2002-04-26 14:39:53 +0000 |
commit | e25554fe843b0cf3f8f69156b2fb19e18d19f655 (patch) | |
tree | 803eb2bf570ea14d6d194b3b5afe719f6ac75d99 /atk/atkutil.c | |
parent | 041a5b0240fda53d0c0a276856b33c01c04e72fa (diff) | |
download | atk-e25554fe843b0cf3f8f69156b2fb19e18d19f655.tar.gz |
Allow for object being NULL which means the window containing the focus
* 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.
Diffstat (limited to 'atk/atkutil.c')
-rwxr-xr-x | atk/atkutil.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/atk/atkutil.c b/atk/atkutil.c index 459a820..7089782 100755 --- a/atk/atkutil.c +++ b/atk/atkutil.c @@ -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); - } } /** |