gtk4.git
2 years agoa11y: Remove an overzealous optimisation
Matthias Clasen [Mon, 19 Jun 2023 10:45:28 +0000 (06:45 -0400)]
a11y: Remove an overzealous optimisation

The result of calling update_property needs
to be that the property is marked as set
afterward, even if the value we pass happens
to match the default value.

After this change, scrollbars have value-now
show up as zero in the accessiblity page of
the inspector, even when that matches the lower
bound.

Test included.

Fixes: #5886
2 years agoMerge branch 'a11y-nest-button-redux' into 'main'
Matthias Clasen [Sun, 18 Jun 2023 15:42:06 +0000 (15:42 +0000)]
Merge branch 'a11y-nest-button-redux' into 'main'

Revert "dropdown: Shuffle accessible roles around"

See merge request GNOME/gtk!6111

2 years agoMerge branch 'main' into 'main'
Matthias Clasen [Sun, 18 Jun 2023 13:19:07 +0000 (13:19 +0000)]
Merge branch 'main' into 'main'

Revert "Use gsk_matrix_transform_point3d consistently"

Closes #5902

See merge request GNOME/gtk!6112

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Sun, 18 Jun 2023 13:14:57 +0000 (13:14 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

memoryformat: Add gdk_memory_format_get_depth()

See merge request GNOME/gtk!6110

2 years agogdk: Replace prefers_high_depth with depth
Benjamin Otte [Fri, 16 Jun 2023 06:00:19 +0000 (08:00 +0200)]
gdk: Replace prefers_high_depth with depth

Now that we track depth, we can also pass it into the GDK frame code.

For now it's just passed along, code acts the same as with
prefers_high_depth.

2 years agorendernode: Change to gsk_render_node_get_preferred_depth()
Benjamin Otte [Thu, 15 Jun 2023 18:27:13 +0000 (20:27 +0200)]
rendernode: Change to gsk_render_node_get_preferred_depth()

Instead of just tracking preferred_high_depth(), track the actual depth
we'd like to have.

2 years agomemoryformat: Add gdk_memory_format_get_depth()
Benjamin Otte [Thu, 15 Jun 2023 18:02:46 +0000 (20:02 +0200)]
memoryformat: Add gdk_memory_format_get_depth()

Replace gdk_memory_format_prefers_high_depth with the more generic
gdk_memory_format_get_depth() that returns the depth of the individual
channels.

Also make the GL renderer use that to pick the generic F16 format
instead of immediately going for F32 when uploading textures.

2 years agoinspector: Handle a11y being disabled
Benjamin Otte [Sat, 17 Jun 2023 20:02:38 +0000 (22:02 +0200)]
inspector: Handle a11y being disabled

2 years agoRevert "Use gsk_matrix_transform_point3d consistently"
Yiğit Burak [Sun, 18 Jun 2023 12:14:23 +0000 (15:14 +0300)]
Revert "Use gsk_matrix_transform_point3d consistently"

Revert commit 440d56a4

2 years agoa11y: Special-case nested buttons
Matthias Clasen [Sun, 18 Jun 2023 12:12:31 +0000 (08:12 -0400)]
a11y: Special-case nested buttons

Special-case nested buttons in our name computation,
since it is hard to reconcile all the a11y attributes
being on the wrapper, but the focus ending up on the
button inside.

This is a pragmatic approach that works. The only
downside is that the wrapper and the button end up
with the same name+description, but at least orca
seems to only read the focus elements' ones.

2 years agoRevert "colordialogbutton: Shuffle accessible roles around"
Matthias Clasen [Sun, 18 Jun 2023 11:35:52 +0000 (07:35 -0400)]
Revert "colordialogbutton: Shuffle accessible roles around"

This reverts commit 343b9d246ff09e24842020e907a681984ea6d610.

Unfortunately, this makes it so that the focus ends up on
the 'generic' accessible, not the one with the label, and
orca remains quiet.

2 years agoRevert "dropdown: Shuffle accessible roles around"
Matthias Clasen [Sun, 18 Jun 2023 11:34:50 +0000 (07:34 -0400)]
Revert "dropdown: Shuffle accessible roles around"

This reverts commit 5ec0b07bafaa0d874fb2e7e0674e46f9d8f8378d.

Unfortunately, this makes it so that the focus ends up on
the 'generic' accessible, not the one with the label, and
orca remains quiet.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 18 Jun 2023 03:03:33 +0000 (03:03 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

testsuite: Add some more a11y tests

See merge request GNOME/gtk!6109

2 years agodropdown: Shuffle accessible roles around
Matthias Clasen [Sun, 18 Jun 2023 02:38:43 +0000 (22:38 -0400)]
dropdown: Shuffle accessible roles around

Make the internal toggle button generic, so that
the a11y checker doesn't complain about it not
having a label. And mark the icons in the popup
as presentational.

2 years agocolordialogbutton: Shuffle accessible roles around
Matthias Clasen [Sun, 18 Jun 2023 02:36:47 +0000 (22:36 -0400)]
colordialogbutton: Shuffle accessible roles around

Make the color button itself take the button role,
and make the internal toggle button just be generic.

This solves the problem that labelled-by relations
that are set up in ui files via mnemonics point at
the toplevel, not the toggle button.

2 years agogtk-demo: a11y improvements
Matthias Clasen [Sun, 18 Jun 2023 02:36:31 +0000 (22:36 -0400)]
gtk-demo: a11y improvements

Make the clipboard demo come up clean in the
a11y checker.

2 years agotestsuite: Add some more a11y tests
Matthias Clasen [Sun, 18 Jun 2023 02:00:04 +0000 (22:00 -0400)]
testsuite: Add some more a11y tests

Test that overriding roles works, both
via g_object_new, and via ui files.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 18 Jun 2023 01:47:50 +0000 (01:47 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gtk-demo: Fix a crash

Closes #4522

See merge request GNOME/gtk!6108

2 years agoApply suggestions from review
Emmanuele Bassi [Sat, 17 Jun 2023 23:44:46 +0000 (23:44 +0000)]
Apply suggestions from review

2 years agovideo: Make the overlay clickable
Matthias Clasen [Sat, 17 Jun 2023 23:00:14 +0000 (19:00 -0400)]
video: Make the overlay clickable

And add missing accessible labels at the same time.

Fixes: #4522
2 years agoinspector: Cosmetic fixes
Matthias Clasen [Sat, 17 Jun 2023 23:05:48 +0000 (19:05 -0400)]
inspector: Cosmetic fixes

Align the values on the a11y page to the right.

2 years agomediacontrols: Add accessible labels
Matthias Clasen [Sat, 17 Jun 2023 22:51:54 +0000 (18:51 -0400)]
mediacontrols: Add accessible labels

2 years agogtk-demo: Misc a11y improvements
Matthias Clasen [Sat, 17 Jun 2023 21:54:39 +0000 (17:54 -0400)]
gtk-demo: Misc a11y improvements

2 years agogtk-demo: Fix a crash
Matthias Clasen [Sat, 17 Jun 2023 21:54:21 +0000 (17:54 -0400)]
gtk-demo: Fix a crash

This was broken in 6b2c088a29e4a819.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 17 Jun 2023 21:20:10 +0000 (21:20 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

colordialogbutton: Sync color

See merge request GNOME/gtk!6107

2 years agoinspector: Limit the width of a11y page
Matthias Clasen [Sat, 17 Jun 2023 20:44:16 +0000 (16:44 -0400)]
inspector: Limit the width of a11y page

Ellipsize labels that can contain long
content to prevent a super-wide window.

2 years agogtk-demo: Misc a11y fixes
Matthias Clasen [Sat, 17 Jun 2023 16:19:05 +0000 (12:19 -0400)]
gtk-demo: Misc a11y fixes

Add some missing labels.

2 years agoinspector: Realize AT ontexts
Matthias Clasen [Sat, 17 Jun 2023 18:48:18 +0000 (14:48 -0400)]
inspector: Realize AT ontexts

Otherwise we don't get change notification...

2 years agoa11y: Set has-popup consistently
Matthias Clasen [Sat, 17 Jun 2023 16:18:34 +0000 (12:18 -0400)]
a11y: Set has-popup consistently

Set the has-popup property when a widget
has a context menu.

2 years agocolordialogbutton: Sync color
Matthias Clasen [Sat, 17 Jun 2023 15:37:22 +0000 (11:37 -0400)]
colordialogbutton: Sync color

Make sure the color of the swatch and the button
are initially in sync. As a side-effect, this
ensures that the swatch has its accessible label
computed at the outset.

2 years agogtk-demo: Cosmetics
Matthias Clasen [Sat, 17 Jun 2023 15:37:11 +0000 (11:37 -0400)]
gtk-demo: Cosmetics

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 17 Jun 2023 15:44:21 +0000 (15:44 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Don't use "Tab list" as an accessible label

Closes #4839

See merge request GNOME/gtk!6106

2 years agoDon't use "Tab list" as an accessible label
Matthias Clasen [Fri, 16 Jun 2023 17:09:16 +0000 (13:09 -0400)]
Don't use "Tab list" as an accessible label

It does not add any extra information.

Fixes: #4839
2 years agoMerge branch 'dropdown-sections' into 'main'
Benjamin Otte [Sat, 17 Jun 2023 06:41:30 +0000 (06:41 +0000)]
Merge branch 'dropdown-sections' into 'main'

dropdown: Add section support

See merge request GNOME/gtk!6102

2 years agogtk-demo: Add an example for dropdown sections
Matthias Clasen [Sat, 17 Jun 2023 01:12:47 +0000 (21:12 -0400)]
gtk-demo: Add an example for dropdown sections

Make one of the dropdowns in the Selections
demo have sections.

2 years agodropdown: Add section support
Matthias Clasen [Sat, 17 Jun 2023 01:12:11 +0000 (21:12 -0400)]
dropdown: Add section support

Add a header-factory property and pass it through
to the listview in the popup.

2 years agoMerge branch 'fix-c4013' into 'main'
Matthias Clasen [Fri, 16 Jun 2023 16:38:22 +0000 (16:38 +0000)]
Merge branch 'fix-c4013' into 'main'

gtkprintoperation-win32.c: Fix build

See merge request GNOME/gtk!6099

2 years agoMerge branch 'a11y-computed-name' into 'main'
Matthias Clasen [Fri, 16 Jun 2023 16:30:51 +0000 (16:30 +0000)]
Merge branch 'a11y-computed-name' into 'main'

atcontext: Update name computation

See merge request GNOME/gtk!6088

2 years agoreference/gtk/coordinates: Fix typos of “widget’s”
Daniel Boles [Thu, 15 Jun 2023 16:40:08 +0000 (17:40 +0100)]
reference/gtk/coordinates: Fix typos of “widget’s”

2 years agoMerge branch 'better_gtkstacksidebar' into 'main'
Matthias Clasen [Thu, 15 Jun 2023 12:54:20 +0000 (12:54 +0000)]
Merge branch 'better_gtkstacksidebar' into 'main'

GtkStackSidebar: Explicitly mark the sidebar items as labeled by the labels

See merge request GNOME/gtk!6100

2 years agoGtkStackSidebar: Explicitly mark the sidebar items as labeled by the labels
Lukáš Tyrychtr [Thu, 15 Jun 2023 12:29:31 +0000 (14:29 +0200)]
GtkStackSidebar: Explicitly mark the sidebar items as labeled by the labels

That improves the reading of the GtkStackSidebar widget considerably.
Previously, Orca would not read the items at all, now it does.

2 years agogtkprintoperation-win32.c: Fix build
Chun-wei Fan [Thu, 15 Jun 2023 10:48:13 +0000 (18:48 +0800)]
gtkprintoperation-win32.c: Fix build

Include the needed headers so that we don't break the build with C4013
warnings, which are treated as errors if msvc_recommended_pragmas.h is
found during build configuration.

2 years agoMerge branch 'listitem' into 'main'
Benjamin Otte [Thu, 15 Jun 2023 10:10:55 +0000 (10:10 +0000)]
Merge branch 'listitem' into 'main'

signallistitemfactory: finish prototype change

See merge request GNOME/gtk!6098

2 years agoMerge branch 'no_random_screen_coords' into 'main'
Matthias Clasen [Thu, 15 Jun 2023 10:02:19 +0000 (10:02 +0000)]
Merge branch 'no_random_screen_coords' into 'main'

gtkatspicomponent: Don't return unitialized stack data as screen positions of widgets

See merge request GNOME/gtk!6097

2 years agosignallistitemfactory: finish prototype change
Marc-André Lureau [Thu, 15 Jun 2023 07:52:34 +0000 (09:52 +0200)]
signallistitemfactory: finish prototype change

Complete the API change from commit be1729b316d ("signallistitemfactory:
Update signal prototype").

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogtkatspicomponent: Don't return unitialized stack data as screen positions of widgets
Lukáš Tyrychtr [Thu, 15 Jun 2023 07:06:30 +0000 (09:06 +0200)]
gtkatspicomponent: Don't return unitialized stack data as screen positions of widgets

We can not compute the correct value, but that does not mean we should return
basically random values from an unitialized stack space.

Rather than that behavior, return zeros concistently.

2 years agoMerge branch 'wip/otte/vulkan-for-main' into 'main'
Benjamin Otte [Wed, 14 Jun 2023 06:01:47 +0000 (06:01 +0000)]
Merge branch 'wip/otte/vulkan-for-main' into 'main'

vulkan: Move some code

See merge request GNOME/gtk!6096

2 years agovulkan: Repurpose debug flags for image uploads
Benjamin Otte [Wed, 14 Jun 2023 01:31:11 +0000 (03:31 +0200)]
vulkan: Repurpose debug flags for image uploads

Now that we don't use the old environment variables anymore to force
staging buffer/image uploads, we don't need them.

However, we do autodetect the fast path for avoiding a staging buffer
now, and we might want to be able to turn that off for testing.

So add GSK_DEBUG=staging that does exactly that.

2 years agovulkan: Remove gsk_vulkan_image_new_from_data()
Benjamin Otte [Wed, 14 Jun 2023 01:26:04 +0000 (03:26 +0200)]
vulkan: Remove gsk_vulkan_image_new_from_data()

This is unused now that all the code uses map/unmap.

The only thing that map/unmap doesn't do that the old code did, was use
a staging image instead as alternative to a staging buffer for image
uploads.

However, that code is not necessary for anything, so I'm sure we can do
without.

2 years agovulkan: Add upload fastpath
Benjamin Otte [Wed, 14 Jun 2023 01:21:24 +0000 (03:21 +0200)]
vulkan: Add upload fastpath

If the memory heap that the GPU uses allows CPU access
(which is the case on basically every integrated GPU, including phones),
we can avoid a staging buffer and write directly into the image memory.

Check for this case and do that automatically.

Unfortunately we need to change the image format we use from
VK_IMAGE_TILING_OPTIMAL to VK_IMAGE_TILING_LINEAR, I haven't found a way
around that yet.

2 years agovulkan: Add gsk_vulkan_memory_can_map()
Benjamin Otte [Wed, 14 Jun 2023 00:55:32 +0000 (02:55 +0200)]
vulkan: Add gsk_vulkan_memory_can_map()

.. nd use it to assert memory is mappable when mapping it.

2 years agovulkan: Use map/unmap for fallback images
Benjamin Otte [Wed, 14 Jun 2023 00:24:20 +0000 (02:24 +0200)]
vulkan: Use map/unmap for fallback images

2 years agovulkan: Render fallback into vulkan memory
Benjamin Otte [Wed, 14 Jun 2023 00:15:29 +0000 (02:15 +0200)]
vulkan: Render fallback into vulkan memory

Use the new map/unmap image upload method for Cairo node drawing:
1. map() the memory
2. create an image surface or that memory
3. draw to that image surface
4. success

There's no longer a need for Cairo to allocate image memory.

2 years agovulkan: Use new upload method for texture uploads
Benjamin Otte [Wed, 14 Jun 2023 00:14:40 +0000 (02:14 +0200)]
vulkan: Use new upload method for texture uploads

gsk_vulkan_image_new_from_texture() now uses the direct copy via
gdk_texture_downloader_download_into().

2 years agovulkan: Add a new way to upload data into images
Benjamin Otte [Wed, 14 Jun 2023 00:08:17 +0000 (02:08 +0200)]
vulkan: Add a new way to upload data into images

As an alternative to gsk_vulkan_image_new_from_data() that
takes a given data and creates an image from it, add a 3 step process:
  gsk_vulkan_image_new_for_upload()
  gsk_vulkan_image_map_memory()
  /* put data into memory */
  gsk_vulkan_image_unmap_memory()

The benefit of this approach is that it potentially avoids a copy;
instead of creating a buffer to pass and writing the data into it before
then memcpy()ing it into the image, the data can be written straight
into image memory.

So far, only the staging buffer upload is implemented.

There are also no users, those come in the next commit(s).

2 years agovulkan: Move some code
Benjamin Otte [Tue, 13 Jun 2023 06:02:06 +0000 (08:02 +0200)]
vulkan: Move some code

Add gsk_vulkan_image_new_from_texture() and use it.

Also rewrite the actual code from using Cairo surfaces to using
GdkTextureDownloader.

2 years agovulkan: Constify upload function
Benjamin Otte [Tue, 13 Jun 2023 06:01:08 +0000 (08:01 +0200)]
vulkan: Constify upload function

2 years agoMerge branch 'wip/carlosg/pad-detection' into 'main'
Matthias Clasen [Wed, 14 Jun 2023 00:10:32 +0000 (00:10 +0000)]
Merge branch 'wip/carlosg/pad-detection' into 'main'

gdk/wayland: Create pad devices on enter

See merge request GNOME/gtk!6094

2 years agogdk: Include pads in GDK_SEAT_CAPABILITY_ALL
Carlos Garnacho [Tue, 13 Jun 2023 22:53:11 +0000 (00:53 +0200)]
gdk: Include pads in GDK_SEAT_CAPABILITY_ALL

The GDK_SEAT_CAPABILITY_TABLET_PAD stood awkwardly out of the
ALL value. Even though it's not a keyboard, its focus has more
resemblance to it, so it should be part of this group together
with keyboards.

2 years agogdk/wayland: Create pad devices on enter
Carlos Garnacho [Tue, 13 Jun 2023 22:16:58 +0000 (00:16 +0200)]
gdk/wayland: Create pad devices on enter

We were creating the pad device on wp_tablet_pad.done, but
at that time we do not know what tablet it is associated with,
thus we cannot get appropriate vid/pid/name properties for it.

To get that, we need to wait for the pad to enter a surface,
at that time we do know what tablet it is associated with, so
we can get better information about the device.

There are pads that may plausibly "change" tablet between
one .enter event and the next (e.g. Wacom Express Key Remote),
but this situation is highly unlikely. The pad devices created
are thus persistent until that situation happens.

2 years agoMerge branch 'mcatanzaro/gtk-show-uri-deprecated-for' into 'main'
Matthias Clasen [Tue, 13 Jun 2023 18:28:32 +0000 (18:28 +0000)]
Merge branch 'mcatanzaro/gtk-show-uri-deprecated-for' into 'main'

Change recommended replacement for gtk_show_uri()

See merge request GNOME/gtk!6093

2 years agoa11y docs: Some updates
Matthias Clasen [Tue, 13 Jun 2023 18:12:16 +0000 (14:12 -0400)]
a11y docs: Some updates

Clarify what UI properties go into the name computation,
and mention the inspector tools for accessiblity.

2 years agoChange recommended replacement for gtk_show_uri()
Michael Catanzaro [Tue, 13 Jun 2023 18:00:15 +0000 (13:00 -0500)]
Change recommended replacement for gtk_show_uri()

Problem is GtkFileLauncher is unable to handle all the types of URIs
that are supported by gtk_show_uri(), e.g. help: URIs. GtkUriLauncher
avoids this problem.

Another problem is that GtkUriLauncher is just generally a better choice
for launching URIs, since you don't have to create a GFile in order to
use it. Porting code is slightly simpler.

The documentation still mentions both GtkFileLauncher and GtkUriLauncher
as options, but most people will use whatever the compiler recommends
when it prints the deprecation warning.

2 years agoMerge branch 'window-clear-resize_cursor-on' into 'main'
Carlos Garnacho [Tue, 13 Jun 2023 11:39:04 +0000 (11:39 +0000)]
Merge branch 'window-clear-resize_cursor-on' into 'main'

window: Clear resize_cursor on leave notify events

See merge request GNOME/gtk!6090

2 years agowindow: Clear resize_cursor on leave notify events
Michel Dänzer [Mon, 12 Jun 2023 16:28:29 +0000 (18:28 +0200)]
window: Clear resize_cursor on leave notify events

When the pointer leaves the window surface, gtk_window_capture_motion
will not be called anymore, so priv->resize_cursor may remain non-NULL
indefinitely without this.

If update_cursor is later called (via gtk_window_maybe_update_cursor) on
a virtual enter notify event (e.g. because the pointer entered a
descendant surface), it would previously re-set the window surface
cursor to priv->resize_cursor, which could result in the wrong cursor
shape being shown for descendant surfaces.

This affected mutter-x11-frames, see
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1557.

One could also say that if the pointer leaves the window surface, it's
trivially not over any window edge.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Mon, 12 Jun 2023 19:18:49 +0000 (19:18 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Matthiasc/for main

See merge request GNOME/gtk!6091

2 years agoci: Collect artifacts from the asan build
Matthias Clasen [Mon, 12 Jun 2023 17:00:16 +0000 (13:00 -0400)]
ci: Collect artifacts from the asan build

2 years agolistitemmanager: Quiet a compiler warning
Matthias Clasen [Mon, 12 Jun 2023 16:46:34 +0000 (12:46 -0400)]
listitemmanager: Quiet a compiler warning

2 years agoMerge branch 'a11y-overlay' into 'main'
Matthias Clasen [Mon, 12 Jun 2023 17:56:26 +0000 (17:56 +0000)]
Merge branch 'a11y-overlay' into 'main'

inspector: Add an a11y overlay

Closes #5883

See merge request GNOME/gtk!6085

2 years agoFix a crash in gtk-demo
Matthias Clasen [Mon, 12 Jun 2023 16:12:29 +0000 (12:12 -0400)]
Fix a crash in gtk-demo

Fixes #5889

2 years agodocs/reference/gtk/running: Incl GDK_DEBUG=portals
Daniel Boles [Mon, 12 Jun 2023 15:29:52 +0000 (16:29 +0100)]
docs/reference/gtk/running: Incl GDK_DEBUG=portals

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5871

2 years agoMerge branch 'focus-modal-windows' into 'main'
Luca Bacci [Mon, 12 Jun 2023 13:55:45 +0000 (13:55 +0000)]
Merge branch 'focus-modal-windows' into 'main'

win32: Focus modal windows when clicking on unfocused parent

See merge request GNOME/gtk!6051

2 years agoMerge branch 'center-dialogs' into 'main'
Luca Bacci [Mon, 12 Jun 2023 13:53:00 +0000 (13:53 +0000)]
Merge branch 'center-dialogs' into 'main'

win32: Center newly created transient windows

Closes #5407

See merge request GNOME/gtk!6050

2 years agoUpdate Czech translation
Daniel Rusek [Mon, 12 Jun 2023 13:14:31 +0000 (13:14 +0000)]
Update Czech translation

2 years agoinspector: Add an a11y overlay
Matthias Clasen [Fri, 9 Jun 2023 20:51:10 +0000 (16:51 -0400)]
inspector: Add an a11y overlay

Add an overlay that shows a11y issues.

For now, this checks for:
 - abstract roles being used
 - elements without labels
 - required attributes
 - required context

2 years agomenubutton: Horizontally expand child
Alice Mikhaylenko [Sat, 10 Jun 2023 20:02:15 +0000 (00:02 +0400)]
menubutton: Horizontally expand child

Set hexpand on the outer box so we don't propagate that expand.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5883

2 years agomenubutton: Normalize label layout
Alice Mikhaylenko [Sat, 10 Jun 2023 20:01:19 +0000 (00:01 +0400)]
menubutton: Normalize label layout

- Remove unnecessary halign=center and hexpand=0 dance
- Set hexpand=false on the outer box so we don't propagate hexpand

2 years agoMerge branch 'misc-a11y-fixes' into 'main'
Matthias Clasen [Mon, 12 Jun 2023 01:48:04 +0000 (01:48 +0000)]
Merge branch 'misc-a11y-fixes' into 'main'

Various a11y improvements

See merge request GNOME/gtk!6089

2 years agogtk4-demo: Some a11y improvements
Matthias Clasen [Sun, 11 Jun 2023 11:04:56 +0000 (07:04 -0400)]
gtk4-demo: Some a11y improvements

Add some labels in the pickers demo.

2 years agofilechooser: Some accessibility improvements
Matthias Clasen [Mon, 12 Jun 2023 00:19:24 +0000 (20:19 -0400)]
filechooser: Some accessibility improvements

2 years agotogglebutton: Set a11y properties on realize
Matthias Clasen [Sun, 11 Jun 2023 23:28:16 +0000 (19:28 -0400)]
togglebutton: Set a11y properties on realize

The pressed property is required, so we need to
make sure that it is set.

2 years agofontchooser: Add one more accessible property
Matthias Clasen [Sun, 11 Jun 2023 16:39:08 +0000 (12:39 -0400)]
fontchooser: Add one more accessible property

2 years agoaboutdialog: Set some accessible properties
Matthias Clasen [Sun, 11 Jun 2023 16:38:42 +0000 (12:38 -0400)]
aboutdialog: Set some accessible properties

2 years agomenubutton: Set accessible relations
Matthias Clasen [Sun, 11 Jun 2023 16:38:06 +0000 (12:38 -0400)]
menubutton: Set accessible relations

In the case where we create the popover, mark it
as labelled by the button.

2 years agoshortcutswindow: Add some accessible properties
Matthias Clasen [Sun, 11 Jun 2023 16:37:52 +0000 (12:37 -0400)]
shortcutswindow: Add some accessible properties

2 years agopasswordentry: Change an accessible role
Matthias Clasen [Sun, 11 Jun 2023 16:37:06 +0000 (12:37 -0400)]
passwordentry: Change an accessible role

The caps-lock icon is really an alert. Maybe
this is in vain, since orca ignores these images.

2 years agoatcontext: Change the way we handle fallback
Matthias Clasen [Sun, 11 Jun 2023 23:27:18 +0000 (19:27 -0400)]
atcontext: Change the way we handle fallback

The tooltip text should only be considered after
all other means are exhausted. but it can be used
for both the name and the description.

See https://www.w3.org/TR/accname-1.2/

2 years agoatcontext: Update name computation
Matthias Clasen [Sun, 11 Jun 2023 12:06:14 +0000 (08:06 -0400)]
atcontext: Update name computation

Implement this sentence from the "Accessible Name
and Description Computation 1.2" spec:

    If the root node's role prohibits naming,
    return the empty string ("").

See https://www.w3.org/TR/accname-1.2/

2 years agoMerge branch 'wip/alice/menu-button' into 'main'
Matthias Clasen [Sun, 11 Jun 2023 15:14:02 +0000 (15:14 +0000)]
Merge branch 'wip/alice/menu-button' into 'main'

menubutton: Horizontally expand child

Closes #5883

See merge request GNOME/gtk!6084

2 years agoMerge branch 'master' into 'main'
Matthias Clasen [Sun, 11 Jun 2023 11:12:52 +0000 (11:12 +0000)]
Merge branch 'master' into 'main'

Reset chars_changed_stamp in _gtk_text_btree_unref

Closes #5544

See merge request GNOME/gtk!6087

2 years agoPopover: If can't get widget rect, zero output ptr
Daniel Boles [Sun, 11 Jun 2023 10:46:36 +0000 (11:46 +0100)]
Popover: If can't get widget rect, zero output ptr

cherry-pick of commit a6d40b610be6acb635d8732c11bb6d866bf2e95d

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/893#note_1766079

2 years agoReset chars_changed_stamp in _gtk_text_btree_unref
Bart Jacobs [Sun, 11 Jun 2023 08:57:41 +0000 (08:57 +0000)]
Reset chars_changed_stamp in _gtk_text_btree_unref

This causes an "Invalid text buffer iterator" warning to be produced if a TextIter is used after the TextBuffer is disposed.

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Sun, 11 Jun 2023 02:19:13 +0000 (02:19 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

mediafile: Load extension at startup with GTK_MEDIA

See merge request GNOME/gtk!6086

2 years agovulkan: Handle new nodes being added correctly
Benjamin Otte [Sun, 11 Jun 2023 01:09:09 +0000 (03:09 +0200)]
vulkan: Handle new nodes being added correctly

When nodes are added, nothing was warning us that we need to bump
N_RENDER_NODES.

Make sure that that's no longer necessary by refactoring the code to
remove the define.

2 years agovulkan: Do intersection check for every node
Benjamin Otte [Sun, 11 Jun 2023 01:01:04 +0000 (03:01 +0200)]
vulkan: Do intersection check for every node

This is more expensive, but it finds more cases, and in particular it
catches corner cases like empty nodes or fully clipped nodes that might
otherwise make the kernel throw signals in our direction.

2 years agovulkan: Handle empty rects in intersects_rect()
Benjamin Otte [Sun, 11 Jun 2023 00:56:50 +0000 (02:56 +0200)]
vulkan: Handle empty rects in intersects_rect()

Apart from the none case, this was already handled, so we just check if
the rect is empty now.

2 years agomediafile: Load extension at startup with GTK_MEDIA
Benjamin Otte [Sat, 26 Dec 2020 13:55:41 +0000 (14:55 +0100)]
mediafile: Load extension at startup with GTK_MEDIA

When the GTK_MEDIA env var is set, check at startup that it works, not
only when the first MediaFile is instantiated.

This has the fortunate side effect that it prints help output for
GTK_MEDIA=help at startup, too.

2 years agoMerge branch 'fontchooser-a11y' into 'main'
Matthias Clasen [Sat, 10 Jun 2023 20:29:45 +0000 (20:29 +0000)]
Merge branch 'fontchooser-a11y' into 'main'

button: Improve accessible setup

See merge request GNOME/gtk!6081

2 years agomenubutton: Horizontally expand child
Alice Mikhaylenko [Sat, 10 Jun 2023 20:02:15 +0000 (00:02 +0400)]
menubutton: Horizontally expand child

Set hexpand on the outer box so we don't propagate that expand.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5883

2 years agomenubutton: Normalize label layout
Alice Mikhaylenko [Sat, 10 Jun 2023 20:01:19 +0000 (00:01 +0400)]
menubutton: Normalize label layout

- Remove unnecessary halign=center and hexpand=0 dance
- Set hexpand=false on the outer box so we don't propagate hexpand