After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725864 - Add GtkPopover a11y
Add GtkPopover a11y
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Accessibility
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 725920 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-03-06 23:21 UTC by Carlos Garnacho
Modified: 2014-03-10 22:13 UTC
See Also:
GNOME target: 3.12
GNOME version: ---


Attachments
window: Add private _gtk_window_list_popovers() (1.83 KB, patch)
2014-03-06 23:22 UTC, Carlos Garnacho
none Details | Review
window: Add popover-added/removed signals (1.87 KB, patch)
2014-03-06 23:22 UTC, Carlos Garnacho
reviewed Details | Review
a11y: Make GtkWindowAccessible know about popovers (3.92 KB, patch)
2014-03-06 23:22 UTC, Carlos Garnacho
none Details | Review
a11y: Add GtkPopopverAccessible (7.93 KB, patch)
2014-03-06 23:22 UTC, Carlos Garnacho
accepted-commit_now Details | Review
testsuite: Update a11y/menubutton3.ui test expectations (1.89 KB, patch)
2014-03-06 23:23 UTC, Carlos Garnacho
none Details | Review
a11y: Make GtkWindowAccessible know about popovers (2.40 KB, patch)
2014-03-10 12:30 UTC, Carlos Garnacho
accepted-commit_now Details | Review
window: Emit a11y signals directly on popover added/removed (2.04 KB, patch)
2014-03-10 12:30 UTC, Carlos Garnacho
needs-work Details | Review
a11y: Add GtkPopopverAccessible (8.99 KB, patch)
2014-03-10 12:30 UTC, Carlos Garnacho
accepted-commit_now Details | Review
testsuite: Update a11y/menubutton3.ui test expectations (1.89 KB, patch)
2014-03-10 12:30 UTC, Carlos Garnacho
accepted-commit_now Details | Review
Thanks Matthias for the suggestions, I've applied those, and also did some changes (2.41 KB, patch)
2014-03-10 15:31 UTC, Carlos Garnacho
none Details | Review
a11y: Add private GtkContainerAccessible functions to add/remove a child (5.31 KB, patch)
2014-03-10 15:31 UTC, Carlos Garnacho
none Details | Review
a11y: Make GtkWindowAccessible know about popovers (2.41 KB, patch)
2014-03-10 15:35 UTC, Carlos Garnacho
committed Details | Review
a11y: Add private GtkContainerAccessible functions to add/remove a child (5.31 KB, patch)
2014-03-10 15:35 UTC, Carlos Garnacho
committed Details | Review
window: Emit a11y signals directly on popover added/removed (2.25 KB, patch)
2014-03-10 15:35 UTC, Carlos Garnacho
committed Details | Review
a11y: Add GtkPopopverAccessible (10.02 KB, patch)
2014-03-10 15:35 UTC, Carlos Garnacho
committed Details | Review
testsuite: Update a11y/menubutton3.ui test expectations (1.90 KB, patch)
2014-03-10 15:35 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2014-03-06 23:21:38 UTC
I'm attaching a few patches that add minimal a11y support for popovers. From what I learned today in #a11y, Orca would do fine with popovers by just figuring out the relationship, even if the atkobject hierarchy doesn't strictly match, so the patches let the popovers' AtkObject be a child of the toplevel's, but set the POPUP_FOR relationship with the relative-to accessible. This turned out to be a lot less intricate than faking a hierarchy between popovers and their relative-to widget.
Comment 1 Carlos Garnacho 2014-03-06 23:22:42 UTC
Created attachment 271154 [details] [review]
window: Add private _gtk_window_list_popovers()

This function will be useful in situations in GTK+ internals.

https://bugzilla.gnome.org/show_bug.cgi?id=725727
Comment 2 Carlos Garnacho 2014-03-06 23:22:51 UTC
Created attachment 271155 [details] [review]
window: Add popover-added/removed signals

This will be necessary for a11y to catch up with popovers being
added/removed.
Comment 3 Carlos Garnacho 2014-03-06 23:22:55 UTC
Created attachment 271156 [details] [review]
a11y: Make GtkWindowAccessible know about popovers
Comment 4 Carlos Garnacho 2014-03-06 23:22:58 UTC
Created attachment 271157 [details] [review]
a11y: Add GtkPopopverAccessible

And let GtkPopover use it as its GtkAccessible implementation, this
accessible sets the POPUP_FOR relationship to the relative-to widget,
and keeps track of changes there.
Comment 5 Carlos Garnacho 2014-03-06 23:23:00 UTC
Created attachment 271158 [details] [review]
testsuite: Update a11y/menubutton3.ui test expectations

Popover is now minimally accessible.
Comment 6 Matthias Clasen 2014-03-07 04:17:15 UTC
Review of attachment 271157 [details] [review]:

Looks ok, but you need to include gtkpopoveraccessible.h in gtk-a11y.h.
With that fix, fine to commit.
Comment 7 Matthias Clasen 2014-03-07 04:18:10 UTC
Review of attachment 271155 [details] [review]:

Do we still need this if we make popovers (internal) children of the window, as proposed in the dnd bug ?
Comment 8 Matthias Clasen 2014-03-07 04:18:18 UTC
Review of attachment 271155 [details] [review]:

Do we still need this if we make popovers (internal) children of the window, as proposed in the dnd bug ?
Comment 9 Carlos Garnacho 2014-03-07 10:17:31 UTC
(In reply to comment #6)
> Review of attachment 271157 [details] [review]:
> 
> Looks ok, but you need to include gtkpopoveraccessible.h in gtk-a11y.h.
> With that fix, fine to commit.

Oh sure, will fix that.

(In reply to comment #7)
> Review of attachment 271155 [details] [review]:
> 
> Do we still need this if we make popovers (internal) children of the window, as
> proposed in the dnd bug ?

I could make GtkWindowAccessible to rely on gtk_container_forall(), as opposed to GtkContainerAccessible's usage of gtk_container_get_children(so _foreach). Although I fear we still need the signals, as AFAIK there nothing we can catch when internal children are added.

Maybe for the time being, we can do with making a couple a11y functions available to GtkWindow, or just handling directly there the signal emission to the AtkObjects.
Comment 10 Matthias Clasen 2014-03-10 11:01:06 UTC
(In reply to comment #9)
> 
> Maybe for the time being, we can do with making a couple a11y functions
> available to GtkWindow, or just handling directly there the signal emission to
> the AtkObjects.

Yes, thats what I would suggest. It is what we've done elsewhere.
Comment 11 Carlos Garnacho 2014-03-10 12:30:46 UTC
Created attachment 271422 [details] [review]
a11y: Make GtkWindowAccessible know about popovers
Comment 12 Carlos Garnacho 2014-03-10 12:30:50 UTC
Created attachment 271423 [details] [review]
window: Emit a11y signals directly on popover added/removed

As those are internal children, there's no signal that GtkWindowAccessible
could catch when those are added or removed, so make GtkWindow poke ATK
signals directly when that happens.
Comment 13 Carlos Garnacho 2014-03-10 12:30:55 UTC
Created attachment 271424 [details] [review]
a11y: Add GtkPopopverAccessible

And let GtkPopover use it as its GtkAccessible implementation, this
accessible sets the POPUP_FOR relationship to the relative-to widget,
and keeps track of changes there.
Comment 14 Carlos Garnacho 2014-03-10 12:30:59 UTC
Created attachment 271425 [details] [review]
testsuite: Update a11y/menubutton3.ui test expectations

Popover is now minimally accessible.
Comment 15 Carlos Garnacho 2014-03-10 12:36:20 UTC
*** Bug 725920 has been marked as a duplicate of this bug. ***
Comment 16 Matthias Clasen 2014-03-10 12:53:03 UTC
Review of attachment 271422 [details] [review]:

::: gtk/a11y/gtkwindowaccessible.c
@@ +299,3 @@
+
+  count = g_list_length (children);
+  g_list_free (children);

Ugh. Could perhaps get the counting done without assembling a list as a side effect... pass &count and do (*count)++ in the callback. I guess the same is true for the containeraccessible implementation.

@@ +315,3 @@
+			(GtkCallback) prepend_widget, &children);
+  ref_child = g_list_nth_data (children, i);
+  g_list_free (children);

Same here, although it may not matter that much in the end.
Comment 17 Matthias Clasen 2014-03-10 13:01:52 UTC
Review of attachment 271423 [details] [review]:

::: gtk/gtkwindow.c
@@ +12262,3 @@
+  g_object_notify (G_OBJECT (child_accessible), "accessible-parent");
+  g_signal_emit_by_name (accessible, "children-changed::add",
+			 -1, child_accessible, NULL);

I think it would be a bit nicer to expose this as a a GtkContainerAccessible method, in gtkcontaineraccessibleprivate.h, and just use it here.

@@ +12292,3 @@
+  g_object_notify (G_OBJECT (child_accessible), "accessible-parent");
+  g_signal_emit_by_name (accessible, "children-changed::remove",
+			 -1, child_accessible, NULL);

Same here
Comment 18 Matthias Clasen 2014-03-10 13:02:17 UTC
Review of attachment 271424 [details] [review]:

sure
Comment 19 Matthias Clasen 2014-03-10 13:02:46 UTC
Review of attachment 271425 [details] [review]:

sure, ok
Comment 20 Carlos Garnacho 2014-03-10 15:31:48 UTC
Created attachment 271439 [details] [review]
Thanks Matthias for the suggestions, I've applied those, and also did some changes

to GtkPopoverAccessible based on suggestions on #a11y:
* Stay on ATK_ROLE_PANEL, to be set to POPUP_MENU when we handle menu models, and
  one is present.
* Set the modal state accordingly, so modal popovers can be discerned from more
  transient, non-modal ones.

a11y: Make GtkWindowAccessible know about popovers
Comment 21 Carlos Garnacho 2014-03-10 15:31:59 UTC
Created attachment 271440 [details] [review]
a11y: Add private GtkContainerAccessible functions to add/remove a child

This may be useful in container implementations, or for internal children
that trigger no signal emission.
Comment 22 Carlos Garnacho 2014-03-10 15:35:18 UTC
Created attachment 271441 [details] [review]
a11y: Make GtkWindowAccessible know about popovers
Comment 23 Carlos Garnacho 2014-03-10 15:35:23 UTC
Created attachment 271442 [details] [review]
a11y: Add private GtkContainerAccessible functions to add/remove a child

This may be useful in container implementations, or for internal children
that trigger no signal emission.
Comment 24 Carlos Garnacho 2014-03-10 15:35:27 UTC
Created attachment 271443 [details] [review]
window: Emit a11y signals directly on popover added/removed

As those are internal children, there's no signal that GtkWindowAccessible
could catch when those are added or removed, so make GtkWindow use the private
GtkContainerAccessible methods to add/remove the child accessible when that
happens.
Comment 25 Carlos Garnacho 2014-03-10 15:35:32 UTC
Created attachment 271444 [details] [review]
a11y: Add GtkPopopverAccessible

And let GtkPopover use it as its GtkAccessible implementation, this
accessible sets the POPUP_FOR relationship to the relative-to widget,
and keeps track of changes there.
Comment 26 Carlos Garnacho 2014-03-10 15:35:37 UTC
Created attachment 271445 [details] [review]
testsuite: Update a11y/menubutton3.ui test expectations

Popover is now minimally accessible.
Comment 27 Carlos Garnacho 2014-03-10 15:36:41 UTC
Small mishap with git-bz here, sorry for the noise...
Comment 28 Matthias Clasen 2014-03-10 20:55:19 UTC
Review of attachment 271441 [details] [review]:

ok
Comment 29 Matthias Clasen 2014-03-10 20:56:35 UTC
Review of attachment 271442 [details] [review]:

ok
Comment 30 Matthias Clasen 2014-03-10 20:57:01 UTC
Review of attachment 271443 [details] [review]:

ok
Comment 31 Matthias Clasen 2014-03-10 20:59:54 UTC
Review of attachment 271444 [details] [review]:

ok
Comment 32 Matthias Clasen 2014-03-10 21:00:29 UTC
Review of attachment 271445 [details] [review]:

ok
Comment 33 Carlos Garnacho 2014-03-10 22:13:19 UTC
Thanks Matthias for the review, this is all now in master.

Attachment 271441 [details] pushed as 9d54fee - a11y: Make GtkWindowAccessible know about popovers
Attachment 271442 [details] pushed as d4d6968 - a11y: Add private GtkContainerAccessible functions to add/remove a child
Attachment 271443 [details] pushed as 168e4fa - window: Emit a11y signals directly on popover added/removed
Attachment 271444 [details] pushed as 31cd153 - a11y: Add GtkPopopverAccessible
Attachment 271445 [details] pushed as faa6db8 - testsuite: Update a11y/menubutton3.ui test expectations