GNOME Bugzilla – Bug 354230
gail_window_get_index_in_parent will crash if root is not GAIL_TOPLEVEL
Last modified: 2006-09-12 17:51:28 UTC
Steps to reproduce: 1. Open LSR behind and start Firefox 2. Use File->Open File or File->Save page as in Firefox to popup file-picker 3. Close the file-picker. 4. Firefox will crash. See also https://bugzilla.mozilla.org/show_bug.cgi?id=348898 Stack trace: Stack trace is as follows:
+ Trace 71544
Other information: Firefox uses native GTK+2 file-picker, which accessible is created by libgail. LSR trys to call get_index_in_parent, but the root accessible of Firefox is *not* managed by libgail. The root can not be casted to GailToplevel, not doesn't have a window_list member.
Created attachment 72182 [details] [review] workaround the crash If we really want to get the correct index, we can traversal its parent's children. But I don't know if we need to do so. Anyway, we should not crash it.
Ginn: I am not sure why mozilla doesn't re-use GailToplevel here. Since you do use libgail for some things, why not derive the mozilla toplevel class from GailTopLevel? I expect other problems if atk_object_get_root isn't a GailToplevel, don't you need to keep a window list in your root object?
also Ginn - minor problem, your patch isn't ANSI C compliant since it adds logic before the declaration of 'toplevel'.
Bill: Currently, mozilla doesn't include gail headers. So the mozilla toplevel class doesn't derive GailTopLevel. It has an array for the window list. Perhaps we can let it use GailTopLevel in the future. Thanks for your help!
Why not just use the existing atk_object_get_root from gail? Is it because you need to override the atk_object_ref_child implementation for it?
(In reply to comment #5) > Why not just use the existing atk_object_get_root from gail? Is it because you > need to override the atk_object_ref_child implementation for it? > Correct. For mozilla window, we creates mozilla accessible instead of gail window. We need to make it a child of the root.
Created attachment 72631 [details] [review] patch to fix crash and implement method for non-GailToplevel implementations
Thanks for the bug report Ginn. Please reopen if this doesn't solve your problem.