Commit Graph

77019 Commits

Author SHA1 Message Date
Matthias Clasen
a2fdeb99e0 gtk-demo: Improve a11y for applauncher
Use the new listitem properties to make
orca read the selected item in the applauncher
demo.
2023-06-19 21:21:55 -04:00
Matthias Clasen
df8d28f5fe listitem: Add accessible-label and -description
Add properties to GtkListItem to set the accessible
label and description of the listitem widget. This
is important, since orca will read these if the
listitem widget ends up with the focus.
2023-06-19 21:21:55 -04:00
Matthias Clasen
838c51cc92 a11y: Add the ARIA ontology
Add a helper function to find out which roles are
superclasses of each other.

This isn't used yet (apart from the existing use for
ranges), but it might be in the future.
2023-06-19 18:38:58 -04:00
Matthias Clasen
315ded687c Docs: update 2023-06-19 18:38:58 -04:00
Matthias Clasen
6855346269 a11y: Treat widget and window as abstract roles
We no longer use these, so we can enforce
that they are abstract.
2023-06-19 18:38:58 -04:00
Matthias Clasen
c2d6f900d9 window: Use application as accessible role
ARIA deems the window role to be abstract,
so lets use the application role instead.

Update affected tests.
2023-06-19 18:38:58 -04:00
Matthias Clasen
85c2d5f14e Add the application role
ARIA has this role. We left it out initially, but
it is an ok fit for toplevel windows, and better
than window, since that is meant to be abstract.
2023-06-19 18:38:58 -04:00
Matthias Clasen
b3eb912cf3 Use generic as default accessible role
The ARIA specs want widget to be abstract role.
We should respect that and use 'generic' instead.
2023-06-19 18:38:58 -04:00
Matthias Clasen
81d9205369 widget: Warn for abstract accessible roles
These should not be used for widgets, so warn if
they are passed to gtk_widget_set_accessible_role()
or gtk_widget_class_set_accessible_role().
2023-06-19 18:38:32 -04:00
Matthias Clasen
152a335cee Add gtk_accessible_role_is_abstract
Move this code from the a11y overlay in the inspector.
It will be used more widely, going forward.
2023-06-19 18:30:41 -04:00
Matthias Clasen
b84650c2a3 Add another a11y test 2023-06-19 18:30:41 -04:00
Matthias Clasen
722bea2943 Merge branch 'a11y-defeat' into 'main'
Give up on warning ATs into submission

See merge request GNOME/gtk!6121
2023-06-19 21:06:13 +00:00
Matthias Clasen
6c337b949d Merge branch 'fix-issue-5899' into 'main'
GtkFileChooserWidget: Fix condition on visit action

Closes #5899

See merge request GNOME/gtk!6103
2023-06-19 20:52:15 +00:00
Matthias Clasen
db97a35dc7 a11y: Remove the unrealized warning
This warning triggers quite a lot when opening
a window while orca is running, which clearly
shows that what it warns about happens in
practice. But fixing it is reentry hell, and
not a battle I'm up for today.
2023-06-19 16:41:39 -04:00
Matthias Clasen
c2fda63b0d Give up on warning ATs into submission
Its been more than a decade since Wayland
has not supported screen coordinates. Clearly
spamming every apps stderr with warnings is
never going to make ATs stop asking for screen
coordinates.

Just give up. Go home
2023-06-19 16:41:20 -04:00
Benjamin Otte
5da64e9e34 Merge branch 'unaligned-access' into 'main'
gtk: Align key_size up to key_align

Closes #5907

See merge request GNOME/gtk!6120
2023-06-19 20:26:18 +00:00
Matt Turner
3f360aa883 gtk: Align key_size up to key_align
Avoids unaligned accesses when e.g. the key_size is 12 and key_align is
8. We need to round the key size up to 16 to ensure that all keys are
appropriately aligned.

This manifested as a failure in the `gtk:gtk / sorter` unit test on
sparc.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5907
2023-06-19 15:55:09 -04:00
Matt Turner
a444045386 gtk: Pass G_ALIGNOF (...) to gtk_sort_keys_new
The sizeof and G_ALIGNOF are often, but not always, identical.
2023-06-19 15:54:51 -04:00
Daniel Boles
584a807ed6 Widget: Also mention get_height in get_alloc depʼn
The deprecation notice seems to have been copied from
get_allocated_width(), but for get_allocation() height is also relevant.
2023-06-19 20:29:23 +01:00
Matthias Clasen
72e5697804 Merge branch 'redo-a11y-name-computation' into 'main'
Reimplement a11y name computation

See merge request GNOME/gtk!6119
2023-06-19 17:49:22 +00:00
Matthias Clasen
93aff8a129 Add more name computation tests
Test the fallback for range values.

This was not working at all before
the previous commit.
2023-06-19 12:40:33 -04:00
Matthias Clasen
c3cfaab479 a11y: Fix name computation for ranges
There were two problems here:

First, the code was checking for the abstract
range role, instead of its subclasses.

Second, the code was calling a string value
getter on a number value. Oops.
2023-06-19 12:40:32 -04:00
Matthias Clasen
663e3d0811 Add tests for accessible name computation 2023-06-19 12:38:51 -04:00
Matthias Clasen
2dc35ec0c1 a11y: Quietly allow realizing unrooted at context
We can't set the display if we don't have a root,
but the default display is more than good enough
for the tests which otherwise would need to do
quite a bit more setup work to make their test
widgets rooted.
2023-06-19 12:38:51 -04:00
Matthias Clasen
a791f235e6 a11y: Only allow get_name/description when realized
These functions rely on self->accessible_role
being set, and that is only the case for realized
contexts.

In practice, this is not a problem. Contexts are
realized before ATs can get their names or descriptions,
and the inspector realizes contexts too, nowadays.

The only place where this caused a hickup is the
testsuite.
2023-06-19 12:38:51 -04:00
Matthias Clasen
7df9cc1b47 label: Stop overriding accessible label
There's no need to, the accessible name computation
picks the content up where it is allowed (and not
overridden by explicit attributes).
2023-06-19 12:38:51 -04:00
Matthias Clasen
4449344fad a11y: Reimplement name computation
Reimplement the name computation to follow the spec
(https://www.w3.org/TR/accname-1.2) more closely.

Also, unify the functions for name and description,
since their only difference is which property/relation
they use.
2023-06-19 12:38:51 -04:00
Matthias Clasen
e1c9f50d26 a11y: Cosmetics
No need to have two code paths doing the same.
2023-06-19 12:38:51 -04:00
Matthias Clasen
1f029229dc Merge branch 'a11y-inspector-tweaks' into 'main'
Move the a11y naming data into gtk proper

See merge request GNOME/gtk!6118
2023-06-19 16:21:31 +00:00
Matthias Clasen
a80dd28e35 a11y: Move naming data to gtkatcontext.c
This is in preparation for using this information
in the name computation.
2023-06-19 11:17:47 -04:00
Matthias Clasen
16077fbdac inspector: Tweak the a11y overlay
Shorten the warnings, and lower some of the
errors to 'not recommended' (where the authoring
guidelines say 'do not label', but aria doesn't
prohibit labels outright).
2023-06-19 11:17:47 -04:00
Matthias Clasen
1906bb5263 a11y: Update the name-prohibited list
ARIA has the time role in this as well.

It does not matter in practice since we don't
have a widget with this role, but lets match
the specs.
2023-06-19 11:17:47 -04:00
Matthias Clasen
a8b907a33c a11y: Cover the printer option widget case too
This is another case of nested control, in this
case it goes two levels deep. Since we already
have this hack, lets use it for all the cases.
This avoids some more complicated workaround.
2023-06-19 11:17:47 -04:00
Matthias Clasen
f2a2e97004 docs: Add guidance on container roles
Provide some guidance on whether group or generic
is a more suitable role for containers.
2023-06-19 11:17:47 -04:00
Matthias Clasen
a86923de94 a11y: Change the role for many containers
The group role that we've used before has some
implications of semantic grouping, whereas these
containers are mainly about layout, so use the
generic role instead.

This should not affect the translation to AT-SPI
at all.

The affected containers are: box, grid, centerbox,
scrolledwindow, viewport, windowhandle, aspectframe.

The role of GtkTreeExpander has been changed to
button instead, since it acts as a button.
2023-06-19 11:15:48 -04:00
Matthias Clasen
4412f25c9f a11y: Treat none and presentation the same
ARIA says these roles are aliases, so treat them
the same.
2023-06-19 11:15:48 -04:00
Benjamin Otte
c40588886b Merge branch 'wip/otte/for-vulkan' into 'main'
vulkan: Add support for different image formats

See merge request GNOME/gtk!6117
2023-06-19 14:30:50 +00:00
Benjamin Otte
4045a0edd1 vulkan: Check for descriptor indexing extension
By checking if the extension is supported and avoiding devices when it
isn't, we avoid critical warnings later.
2023-06-19 15:08:00 +02:00
Benjamin Otte
636591c080 vulkan: Refactor function
Instead of checking for one specific extension, instead pass the
extension to check for by name.

This way we can reuse it for different extensions.
2023-06-19 15:08:00 +02:00
Benjamin Otte
aa6c670f15 vulkan: Add support for high bit depth 2023-06-19 15:08:00 +02:00
Benjamin Otte
746d0d8fde vulkan: Don't create unnecessary render passes
Pass the render pass to the pipeline creation function instead of
creating an extra one just for pipeline creation.
2023-06-19 15:08:00 +02:00
Benjamin Otte
35b09c727a vulkan: Put the framebuffer in the renderpass
... instead of having fancy caching.

That caching is complicated and it's not necessary.
2023-06-19 15:08:00 +02:00
Benjamin Otte
c35f491795 vulkan: Store the VkFormat in GskVulkanImage
... and use that info when creating renderpasses.
2023-06-19 15:08:00 +02:00
Benjamin Otte
5b64ca7e0a vulkan: Pick high depth texture for high depth nodes
If a node has a higher depth, pick the RGBA format that has that depth
as the texture format we're renderig to with render_texture().

Support for adapting the swapchain is not part of this.
2023-06-19 15:08:00 +02:00
Benjamin Otte
d61737ac7a vulkan: Add format fallback
When a GdkMemoryFormat isn't supported, pick close formats that have a
higher chance of being supported.
Make sure this works recursively and the whole loop always ends up at
R8G8B8A8_UNORM because that one is mandatory.

Roughly, follow these rules:
1. Drop the unpremultiplied
2. Expand channels to include all of RGBA
3. pick swizzle that is RGBA
4. pick next largest depth
5. pick R8G8B8A8_UNORM
2023-06-19 15:08:00 +02:00
Benjamin Otte
ba28971a18 vulkan: Allow mapping images as "read" and/or "write"
This way, we unify the code paths for memory access to textures.

We also technically gain the ability to modify images, though I have no
use case for this.
2023-06-19 15:08:00 +02:00
Benjamin Otte
7b4846bc25 vulkan: Pass format to offscreen creation function
That way, the offscreen can create images of different types.

Its not used in this commit, but will come in handy when we want to
support high bit depth.
2023-06-19 15:08:00 +02:00
Benjamin Otte
eb3ccfb404 vulkan: Remove gsk_vulkan_image_new_for_framebuffer()
Use gsk_vulkan_image_new_for_offscreen() instead, it does the same thing
pretty much.
2023-06-19 15:08:00 +02:00
Benjamin Otte
e4c37ceb34 vulkan: Allow uploading in different formats
This requires quite some code because Vulkan may not support all the
formats and then we need to detect that and fallback properly.
2023-06-19 15:08:00 +02:00
Benjamin Otte
dae1e2b117 vulkan: Create the view in vulkan_image_new()
All callers want it created anyway.

Plus, we can consolidate things in future commits.
2023-06-19 15:08:00 +02:00