Commit Graph

66802 Commits

Author SHA1 Message Date
Matthias Clasen
bba6d604f0 window: Maintain accessible HIDDEN state
We want to use the HIDDEN state to control when
things get added and removed from the accessible
tree, so ensure that we a) set HIDDEN to true
initially for windows, and b) we update HIDDEN
when a window is shown or hidden.

The second part is handled by gtk_widget_hide
for other widgets, but hiding a window does not
always go through that code path.
2020-10-24 15:25:03 -04:00
Matthias Clasen
274f9ad919 a11y: Emit child notification when toplevels get hidden
When a toplevel window gets hidden (and not destroyed),
the frontend code set the HIDDEN state, and we need to
emit child notification when that happens.
2020-10-24 13:17:20 -04:00
Matthias Clasen
89a8c89663 a11y: Improve child index helpers
We need to use gtk_accessible_should_present() whenever we
calculate accessible tree positions, to avoid inconsistencies.

While we are at it, make these helpers usable for finding
the position of accesibles that are now ignored, by not
looking at should_present for the object itself. This will
be relevant when we calculate the position of objects whose
HIDDEN state changes.
2020-10-24 13:14:44 -04:00
Matthias Clasen
e7b290debb a11y: Improve child notification for toplevels
We need to translate the list model position into
an accessible tree position, since hidden toplevels
will be skipped.

While we are at it, add an api for this notification
that will be used in the next commit.
2020-10-24 13:13:07 -04:00
Matthias Clasen
46e754a17d a11y: Skip non-presented children when required
Whenever we determine the index of a child, we need
to skip its non-presented siblings.
2020-10-24 11:22:09 -04:00
Matthias Clasen
b12992c1cb a11y: Handle HIDDEN state changes
Hidden elements are not presented in the accessible
tree, so when then HIDDEN state changes, we should
emit child-added or -removed signals.

This commit does not yet handle all cases (HIDDEN
toplevels or hidden stack pages are not handled),
but it should cover the common case.
2020-10-24 11:17:56 -04:00
Matthias Clasen
374a451eeb a11y: Don't present HIDDEN accessibles
The ARIA spec is clear on this: when an element has the
HIDDEN state, it should not be presented in the accessible
tree.

This change is incomplete, we also need to emit child-added/
removed signals when the state changes, but that needs to
wait for the child added infrastructure to land.
2020-10-24 11:17:56 -04:00
Matthias Clasen
1e13acb206 widget: Don't add reordered children
gtk_widget_reposition_after is called both to add new children,
and to reposition existing children. We only want to emit
accessible changes in the former case (since AT-SPI doesn't
have events for reordering).
2020-10-24 11:17:56 -04:00
Matthias Clasen
5b2b2feb9f a11y: Fix up state / change enum confusion 2020-10-24 11:17:56 -04:00
Matthias Clasen
a11ab6c995 a11y: Handle stack case for addition/removal
Since we interpose stack pages as non-widget accessibles,
we need to tweak the signals we emit when their corresponding
widgets get added or removed.
2020-10-22 10:06:06 -04:00
Matthias Clasen
1d802881eb stack: Change ordering for removal
Unparent the child widget before tearing down its
stack page. This is necessary so a11y can still access
the stack page accessible to emit change notification
when it learns that the child is removed.
2020-10-22 10:05:17 -04:00
Emmanuele Bassi
e45dd771db a11y: Emit ChildrenChanged for toplevel list changes
GtkAtSpiRoot is not a context, which means it needs to emit
ChildrenChanged events by itself whenever a toplevel is added to, or
removed from, the list of toplevels.
2020-10-21 15:37:57 +01:00
Emmanuele Bassi
698cbee1fb a11y: Move ChildrenChanged emitter to ATSPI utilities
We are going to use it from GtkAtSpiRoot, which is not a
GtkAtSpiContext.
2020-10-21 15:18:23 +01:00
Emmanuele Bassi
f1e14c4858 a11y: Implement ChildrenChanged atspi.Event 2020-10-21 14:33:20 +01:00
Emmanuele Bassi
8d46bd1d7c a11y: Notify of changes in the children list 2020-10-21 14:04:49 +01:00
Emmanuele Bassi
fbb08a30e2 a11y: Add child state change to GtkATContext
And the required private API in GtkAccessible to notify AT contexts of
changes in the children list.
2020-10-21 14:04:49 +01:00
Matthias Clasen
8880e3bd2e Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2729
2020-10-21 11:43:58 +00:00
Timm Bäder
0b5b908a74 Merge branch 'wip/exalm/nullable' into 'master'
widget: Add missing (nullable) on binding functions

See merge request GNOME/gtk!2730
2020-10-21 08:17:45 +00:00
Alexander Mikhaylenko
31a072497d widget: Add missing (nullable) on binding functions
Even though they are marked as (skip), they are used in Vala and have wrong
types there atm.
2020-10-21 12:27:51 +05:00
Matthias Clasen
cbb6828657 docs: Document more accessible roles
Document that GtkText is skipped in accessibility.
2020-10-20 23:19:30 -04:00
Matthias Clasen
8e170217a1 Cosmetics
Typo fix.
2020-10-20 23:19:18 -04:00
Matthias Clasen
36d4a8090f docs: Document more accessible roles
GtkColumnView and its various components use a lot
of accessible roles.
2020-10-20 23:09:11 -04:00
Matthias Clasen
341244203f docs: Document more accessible roles
GtkListView and GtkGridView were missing this as well.
2020-10-20 22:53:30 -04:00
Matthias Clasen
2023914186 docs: Document accessible roles of some classes
GtkListBox and GtkFlowBox were missing this.
2020-10-20 22:51:11 -04:00
Matthias Clasen
ef9ec43469 a11y: Add some more tests 2020-10-20 22:44:24 -04:00
Matthias Clasen
67411701c6 inspector: Show accessible object path
Show the object path of the object on the a11y bus,
this is can be useful information. While we are here,
make sure that the Inspector does not throw criticals
when used with GTK_NO_A11Y=1.
2020-10-20 21:56:54 -04:00
Matthias Clasen
e20a3339bf atsi: Fix emission of text selection changes
We were not emitting text-selection-changed and
text-caret-moved as expected.
2020-10-20 21:31:23 -04:00
Matthias Clasen
a8baee342c a11y: Fix handling of LABELLED_BY relation
There were several places where we were confusing
GList and GSList and list->data and list->next, causing
a crash in the accessible name computation for buttons
with mnemonic labels.
2020-10-20 21:27:39 -04:00
Matthias Clasen
6a1cb3304b docs: Mention subclassing and destroy in the migration guide
Mention changes regarding subclassing and life-cycle
handling in the migration guide.
2020-10-20 18:26:38 -04:00
Benjamin Otte
45400fe381 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

Closes #3280

See merge request GNOME/gtk!2725
2020-10-20 14:05:49 +00:00
Matthias Clasen
5504278b78 Merge branch 'matthiasc/for-master' into 'master'
Some more a11y tests

See merge request GNOME/gtk!2726
2020-10-20 05:57:45 +00:00
Matthias Clasen
93481e6c2e a11y: Add tests for GtkFlowBox
Test that roles, states and properties are as expected.
2020-10-20 01:12:20 -04:00
Matthias Clasen
b9e9898212 a11y: Add tests for GtkListBox
Test that roles, states and properties are as expected.
2020-10-20 01:07:13 -04:00
Matthias Clasen
7c47b6907b a11y: Add tests for GtkStack and GtkStackSwitcher
Test that the roles, states and relations are
as expected.
2020-10-20 00:46:07 -04:00
Matthias Clasen
b10d5ec8ff a11y: Add a test for label properties
Now that we set the label property, we should test it too.
2020-10-20 00:25:39 -04:00
Benjamin Otte
8dad615f04 gtk: Remove unused header include
gtkcssnodeprivate.h was mainly used for repositioning CSS nodes in
gadgets, and gadgets are gone now.
2020-10-20 04:50:12 +02:00
Benjamin Otte
23e086089d entry: Keep widget order
... instead of just ordering the CSS nodes.
2020-10-20 04:50:12 +02:00
Benjamin Otte
9317a9f35c flowbox: Keep widget order
... instead of just ordering the CSS nodes.
2020-10-20 04:50:12 +02:00
Benjamin Otte
22100089c3 listbox: Reorder the widgets when sorting
... instead of just reordering the CSS nodes.
2020-10-20 04:50:12 +02:00
Benjamin Otte
074d54ef5a listitemwidget: Remove unnecessary code
gtk_widget_insert_after() reorders CSS nodes properly.
2020-10-20 04:50:12 +02:00
Benjamin Otte
ddd1b0958d notebook: Remove unnecessary code
gtk_widget_insert_after() reorders CSS nodes properly.

Also fix page reordering code to actually reorder the widget instead of
just the CSS nodes.
2020-10-20 04:50:12 +02:00
Benjamin Otte
d77902365d box: Remove unnecessary code
gtk_widget_insert_after() reorders CSS nodes properly.
2020-10-20 04:50:12 +02:00
Benjamin Otte
d9b216e629 widget: Always update the CSS node
Anybody who keeps their own CSS nodes around or wants to order CSS nodes
different from widgets will from now on have to do it manually all the
time.

This is outdated behavior, nobody should be doing either of those two
things.

Also, the correct case is much more common, and not doing it
automatically was causing bugs.

Fixes #3280
2020-10-20 04:50:12 +02:00
Matthias Clasen
a7bd6b094a Merge branch 'matthiasc/for-master' into 'master'
Some a11y docs and fixes

See merge request GNOME/gtk!2724
2020-10-20 01:45:17 +00:00
Matthias Clasen
eeae1b1ea7 a11y: Fix accessible tree inconsistency
The stack page objects were not properly integrated
in the accessible tree - they were appearing as parent
of the pages when navigating up, but not as children
of the stack when navigating down.
2020-10-19 21:15:44 -04:00
Matthias Clasen
0a71dc1bed stack: Minor doc addition 2020-10-19 21:15:44 -04:00
Matthias Clasen
feb73a5ebb docs: Flesh out a11y section
Add some advice for making custom widgets accessible.
2020-10-19 20:01:57 -04:00
Matthias Clasen
83d8ae2f30 Merge branch 'wip/chergert/fix-macos-surface-under-pointer' into 'master'
macos: fix discovery of surface under pointer

See merge request GNOME/gtk!2722
2020-10-19 21:26:47 +00:00
Emmanuele Bassi
51f5690ae3 Merge branch 'ebassi/for-master' into 'master'
Ebassi/for master

See merge request GNOME/gtk!2720
2020-10-19 20:26:57 +00:00
Matthias Clasen
e58e6a0fbe Merge branch 'a11y/editable' into 'master'
Improve the accessible support for editables

See merge request GNOME/gtk!2719
2020-10-19 20:16:21 +00:00