Re: [g-a-devel] Focus problems



Also Ashu:

If your object/container may sometimes contain a very large number of objects, you might consider using the MANAGES_DESCENDANTS state to inform the AT that the object potentially is too big to enumerate; some kinds of lists and tables use this state now, to help reduce performance issues. Containers like this should emit 'active-descendant-changed' events when the local 'focus' changes - in such cases I don't believe that we emit 'focus:' as well. You will probably also need to implement AtkSelection, if your container allows the user to select items inside it. There is also a distinction between 'selection' and 'focus', the active descendant is normally "focussed" from the keyboard perspective, but not necessarily selected; this allows the user to keyboard navigate without changing the selection state of the container's children. For instance gtktreeview allows 'control arrow' navigation without moving the selection, and similar distinction is made in the nautilus icon view.

- Bill

padraig o'briain wrote:

Ashu,

You might also look at gtkhtml2/libgtkhtml/a11y/htmlviewaccessible.c.
This code deals with a similar problem to yours.

gtkhtml2 is used in GNOME's help browser, yelp. When a link is focused
a "grab_focus" signal is emitted on the containing widget, a HtmlView.
Its code is in gtkhtml2/libgtkhtml/view/htmlview.c.

The function html_view_accessible_grab_focus_cb() ensure that the focus
notification is received on the correct object.

Padraig

padraig o'briain wrote:
Ashu,

If you are creating your own AtkObjects you will also need to deal with
focus notification. If you want gnopernicus to become aware that an
object has received focus you need to call atk_focus_tracker_notify()
for the object which has focus.

You could look at how we deal with this in gail.c.

Padraig

Ashu Sharma wrote:

Hi again,

I'm having some problems with the focus and how gnopernicus follows it.

If we have a webpage which has a number of "widgets" on it (that are
not actual GtkWidget's but are things directly drawn on the GdkWindow
of the client area) and we manually draw focusrects around links etc,
how do we notify atk so that gnopernicus queries us for that "widget"
and reads it out.

I have a GtkLayout on which the entire page is rendered and when the
focus is on a link on the page, I create an AtkObject for it (with
AtkAction, etc.) and issue the following notification:

AtkStateSet *stateSet = my_link_ref_state_set (linkAtkObject);
atk_state_set_add_state (stateSet, ATK_STATE_FOCUSED);
atk_object_notify_state_change (linkAtkObject, ATK_STATE_FOCUSED, true);

After this, gnopernicus does query the linkAtkObject for its details
but never reads them out. Is this because there is no physical widget
for the link? Or is it because the actual focus (gtk's focus) is on
the GtkLayout which houses all the content of the page? I also tried
atk_state_set_remove_state(stateSetOfPageAtkObject,
ATK_STATE_FOCUSED); but it did not help.

What should be the correct procedure here? This seems like a generic
problem with any AtkObjects that do not have an actual GtkWidget. I
think I'm doing the above incorrectly.

Thanks,
Ashutosh
_______________________________________________
Gnome-accessibility-devel mailing list
Gnome-accessibility-devel gnome org
http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel

_______________________________________________
Gnome-accessibility-devel mailing list
Gnome-accessibility-devel gnome org
http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel


_______________________________________________
Gnome-accessibility-devel mailing list
Gnome-accessibility-devel gnome org
http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]