gtk4.git
2 years agovulkan: Rebuild the precompiled shaders
Benjamin Otte [Tue, 20 Jun 2023 18:16:07 +0000 (20:16 +0200)]
vulkan: Rebuild the precompiled shaders

We forgot that with all the changes.

2 years agovulkan: Take offscreen fromat from context
Benjamin Otte [Tue, 20 Jun 2023 14:35:55 +0000 (16:35 +0200)]
vulkan: Take offscreen fromat from context

We want to create offscreens in compatible formats, and in particular we
want to ideally use the same format as rendering would use.

2 years agovulkan: Use 3 descriptor sets, not 3 bindings
Benjamin Otte [Tue, 20 Jun 2023 13:39:29 +0000 (15:39 +0200)]
vulkan: Use 3 descriptor sets, not 3 bindings

It turns out variable length is only supported for the last binding in
a set, not for every binding.
So we need to create one set for each of our arrays.

[ VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-pBindingFlags-03004 ] Object 0: handle = 0x33a9f10, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xd3f353a | vkCreateDescriptorSetLayout(): pBindings[0] has VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT but 0 is the largest value of all the bindings. The Vulkan spec states: If an element of pBindingFlags includes VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, then all other elements of VkDescriptorSetLayoutCreateInfo::pBindings must have a smaller value of binding (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-pBindingFlags-03004)

2 years agovulkan: Use the right flags
Benjamin Otte [Tue, 20 Jun 2023 13:32:23 +0000 (15:32 +0200)]
vulkan: Use the right flags

Somebody (me) had flipped the 2 flags in commit ba28971a183:

[ VUID-vkCmdCopyBufferToImage-srcBuffer-00174 ] Object 0: handle = 0x3cfaac0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x430000000043, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0xe1b276a1 | Invalid usage flag for VkBuffer 0x430000000043[] used by vkCmdCopyBufferToImage. In this case, VkBuffer should have VK_BUFFER_USAGE_TRANSFER_SRC_BIT set during creation. The Vulkan spec states: srcBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-srcBuffer-00174)

2 years agovulkan: Set descriptorBindingStorageBufferUpdateAfterBind
Benjamin Otte [Tue, 20 Jun 2023 13:29:45 +0000 (15:29 +0200)]
vulkan: Set descriptorBindingStorageBufferUpdateAfterBind

It's necessary now that we use storage buffers for gradients:

[ VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingStorageBufferUpdateAfterBind-03008 ] Object 0: handle = 0x1e72d70, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x943cc552 | vkCreateDescriptorSetLayout(): pBindings[0] can't have VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT for VK_DESCRIPTOR_TYPE_STORAGE_BUFFER since descriptorBindingStorageBufferUpdateAfterBind is not enabled. The Vulkan spec states: If VkPhysicalDeviceDescriptorIndexingFeatures::descriptorBindingStorageBufferUpdateAfterBind is not enabled, all bindings with descriptor type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER must not use VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingStorageBufferUpdateAfterBind-03008)

2 years agovulkan: Remove unused declaration from shader
Benjamin Otte [Mon, 19 Jun 2023 17:29:13 +0000 (19:29 +0200)]
vulkan: Remove unused declaration from shader

2 years agoMerge branch 'wip/otte/for-vulkan' into 'main'
Benjamin Otte [Mon, 19 Jun 2023 14:30:50 +0000 (14:30 +0000)]
Merge branch 'wip/otte/for-vulkan' into 'main'

vulkan: Add support for different image formats

See merge request GNOME/gtk!6117

2 years agovulkan: Check for descriptor indexing extension
Benjamin Otte [Mon, 19 Jun 2023 12:54:00 +0000 (14:54 +0200)]
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.

2 years agovulkan: Refactor function
Benjamin Otte [Mon, 19 Jun 2023 12:48:37 +0000 (14:48 +0200)]
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.

2 years agovulkan: Add support for high bit depth
Benjamin Otte [Sun, 18 Jun 2023 12:00:39 +0000 (14:00 +0200)]
vulkan: Add support for high bit depth

2 years agovulkan: Don't create unnecessary render passes
Benjamin Otte [Sat, 17 Jun 2023 17:15:05 +0000 (19:15 +0200)]
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.

2 years agovulkan: Put the framebuffer in the renderpass
Benjamin Otte [Sat, 17 Jun 2023 16:53:33 +0000 (18:53 +0200)]
vulkan: Put the framebuffer in the renderpass

... instead of having fancy caching.

That caching is complicated and it's not necessary.

2 years agovulkan: Store the VkFormat in GskVulkanImage
Benjamin Otte [Sat, 17 Jun 2023 14:05:09 +0000 (16:05 +0200)]
vulkan: Store the VkFormat in GskVulkanImage

... and use that info when creating renderpasses.

2 years agovulkan: Pick high depth texture for high depth nodes
Benjamin Otte [Thu, 15 Jun 2023 21:17:40 +0000 (23:17 +0200)]
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.

2 years agovulkan: Add format fallback
Benjamin Otte [Thu, 15 Jun 2023 21:13:31 +0000 (23:13 +0200)]
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

2 years agovulkan: Allow mapping images as "read" and/or "write"
Benjamin Otte [Thu, 15 Jun 2023 12:29:15 +0000 (14:29 +0200)]
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.

2 years agovulkan: Pass format to offscreen creation function
Benjamin Otte [Wed, 14 Jun 2023 19:32:26 +0000 (21:32 +0200)]
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.

2 years agovulkan: Remove gsk_vulkan_image_new_for_framebuffer()
Benjamin Otte [Wed, 14 Jun 2023 19:20:56 +0000 (21:20 +0200)]
vulkan: Remove gsk_vulkan_image_new_for_framebuffer()

Use gsk_vulkan_image_new_for_offscreen() instead, it does the same thing
pretty much.

2 years agovulkan: Allow uploading in different formats
Benjamin Otte [Wed, 14 Jun 2023 18:37:58 +0000 (20:37 +0200)]
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.

2 years agovulkan: Create the view in vulkan_image_new()
Benjamin Otte [Wed, 14 Jun 2023 18:36:14 +0000 (20:36 +0200)]
vulkan: Create the view in vulkan_image_new()

All callers want it created anyway.

Plus, we can consolidate things in future commits.

2 years agotestsuite: Unify skipping memorytexture test
Benjamin Otte [Mon, 19 Jun 2023 13:03:51 +0000 (15:03 +0200)]
testsuite: Unify skipping memorytexture test

... and make it handle more cases of failure, in particular OpenGL and
Vulkan being unsupported by the system.

2 years agoMerge branch 'more-a11y-tweaks' into 'main'
Emmanuele Bassi [Mon, 19 Jun 2023 12:53:10 +0000 (12:53 +0000)]
Merge branch 'more-a11y-tweaks' into 'main'

A11y improvements

See merge request GNOME/gtk!6116

2 years agodocs: Expand role docs
Matthias Clasen [Mon, 19 Jun 2023 12:26:38 +0000 (08:26 -0400)]
docs: Expand role docs

Clarify that presentation and none
can be used interchangeably.

2 years agodropdown: Use presentation instead of none
Matthias Clasen [Mon, 19 Jun 2023 12:23:30 +0000 (08:23 -0400)]
dropdown: Use presentation instead of none

2 years agotestsuite: Add a vulkan method to memorytexure test
Benjamin Otte [Wed, 14 Jun 2023 08:24:39 +0000 (10:24 +0200)]
testsuite: Add a vulkan method to memorytexure test

This uses the newly added NULL-surface renderer.

2 years agovulkan: Make gsk_renderer_realize() work with NULL surface
Benjamin Otte [Wed, 14 Jun 2023 08:18:47 +0000 (10:18 +0200)]
vulkan: Make gsk_renderer_realize() work with NULL surface

Pretty much copy what GL does and just use the default display to create
GPU-related resources without the need for a display.

This also adds gdk_display_create_vulkan_context() but I've
kept it private because the Vulkan API is generally considered in flux,
in particular with our pending attempts to redo how renderers work.

2 years agovulkan: Actually reset the buffer size
Benjamin Otte [Sun, 18 Jun 2023 16:38:48 +0000 (18:38 +0200)]
vulkan: Actually reset the buffer size

Fixes a bug introduced in d1135f9e3c7.

Luckily the buffer was large enough that all my testing didn't catch it
because it took a few minutes to overflow.

2 years agovulkan: Renaming fix
Benjamin Otte [Wed, 14 Jun 2023 06:31:36 +0000 (08:31 +0200)]
vulkan: Renaming fix

This rename was a long time ago...

2 years agomodelbutton: Set a11y shortcuts
Matthias Clasen [Mon, 19 Jun 2023 00:59:33 +0000 (20:59 -0400)]
modelbutton: Set a11y shortcuts

2 years agoprintdialog: Some a11y improvements
Matthias Clasen [Sun, 18 Jun 2023 19:30:05 +0000 (15:30 -0400)]
printdialog: Some a11y improvements

Add proper roles and labels in some places.

2 years agoprintdialog: Give the page range entry a label
Matthias Clasen [Sun, 18 Jun 2023 17:04:52 +0000 (13:04 -0400)]
printdialog: Give the page range entry a label

This is mainly to pacify the a11y checker.

2 years agonotebook: Make sure tabs are labelled
Matthias Clasen [Sun, 18 Jun 2023 19:16:28 +0000 (15:16 -0400)]
notebook: Make sure tabs are labelled

2 years agowindowcontrols: Cosmetics
Matthias Clasen [Sun, 18 Jun 2023 17:04:34 +0000 (13:04 -0400)]
windowcontrols: Cosmetics

2 years agodropdown: Avoid accessibility warnings
Matthias Clasen [Sun, 18 Jun 2023 17:04:02 +0000 (13:04 -0400)]
dropdown: Avoid accessibility warnings

The image here is just presentational.

2 years agoinfobar: Improve a11y labelling
Matthias Clasen [Sun, 18 Jun 2023 17:00:06 +0000 (13:00 -0400)]
infobar: Improve a11y labelling

Treat the close button the same way we treat
the window close button, wrt. to accessibility.

2 years agogtk-demo: Miscellaneous a11y improvements
Matthias Clasen [Sun, 18 Jun 2023 16:59:51 +0000 (12:59 -0400)]
gtk-demo: Miscellaneous a11y improvements

2 years agoMerge branch 'a11y-remove-value-opt' into 'main'
Emmanuele Bassi [Mon, 19 Jun 2023 11:46:19 +0000 (11:46 +0000)]
Merge branch 'a11y-remove-value-opt' into 'main'

a11y: Remove an overzealous optimisation

Closes #5886

See merge request GNOME/gtk!6115

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.