gtk4.git
2 years agorendernode: Use cairo_set_device_offset()
Benjamin Otte [Sun, 21 May 2023 03:03:49 +0000 (05:03 +0200)]
rendernode: Use cairo_set_device_offset()

Simplifies the code.

2 years agotestsuite: Adapt color-matrix testcase
Benjamin Otte [Sun, 21 May 2023 02:48:46 +0000 (04:48 +0200)]
testsuite: Adapt color-matrix testcase

Make it use an alpha value that is well defined, ie 0.4 instead of 0.5.

0.4 * 255 = 102
0.5 * 255 = 127.5

This avoids rounding issues where some math may cause the resulting
alpha value to be 127, and some other math ends up with 128.

2 years agotestsuite: fix memleak
Benjamin Otte [Sun, 4 Jun 2023 18:15:24 +0000 (20:15 +0200)]
testsuite: fix memleak

Also use the actual diff command we found instead of searching for it
again.

2 years agoMerge branch 'wip/otte/vulkan' into 'main'
Benjamin Otte [Sun, 4 Jun 2023 18:21:21 +0000 (18:21 +0000)]
Merge branch 'wip/otte/vulkan' into 'main'

Vulkan hacking going overboard

See merge request GNOME/gtk!5992

2 years agovulkan: Create multiple render objects
Benjamin Otte [Wed, 24 May 2023 14:55:18 +0000 (16:55 +0200)]
vulkan: Create multiple render objects

Sometimes the GPU is still busy when the next frame starts (like when
no-vsync benchmarking), so we need to keep all those resources alone and
create new ones.
That's what the render object is for, so we just create another one.

However, when we create too many, we'll starve the CPU. So we'll limit
it. Currently, that limit is at 4, but I've never reached it (I've also
not starved the GPU yet), so that number may want to be set lower/higher
in the future.

Note that this is different from the number of outstanding buffers, as
those are not busy on the GPU but on the compositor, and as such a
buffer may have not finished rendering but have been returend from the
compositor (very busy GPU) or have finished rendering but not been
returned from the compositor (very idle GPU).

2 years agovulkan: Stop differentiating rounded from cicular corners
Benjamin Otte [Tue, 23 May 2023 21:47:55 +0000 (23:47 +0200)]
vulkan: Stop differentiating rounded from cicular corners

Our shaders can handle both, so don'ttry to tell them apart anymore.

Removes a lot of unnecessary fallbacks.

2 years agovulkan: Cleanup: Initialize constants at the top
Benjamin Otte [Tue, 23 May 2023 03:32:35 +0000 (05:32 +0200)]
vulkan: Cleanup: Initialize constants at the top

2 years agovulkan: Add support for texture-scale nodes
Benjamin Otte [Tue, 23 May 2023 03:26:08 +0000 (05:26 +0200)]
vulkan: Add support for texture-scale nodes

2 years agovulkan: Split textures and samplers
Benjamin Otte [Tue, 23 May 2023 03:08:13 +0000 (05:08 +0200)]
vulkan: Split textures and samplers

The idea here is that we can do more complex combinations and use that
to support texture-scale nodes or use fancy texture formats (suc as
YUV).

I'm not sure this is actually necessary, but for now it gives more
flexibility.

2 years agovulkan: Add a hackish way to handle empty children
Benjamin Otte [Mon, 22 May 2023 02:21:02 +0000 (04:21 +0200)]
vulkan: Add a hackish way to handle empty children

For blend and crossfade nodes, one of the children may exist and
influence the rendering, while the other does not.

Previously, we would skip the node, which would cause the required
rendering to not happen. We now send a valid texture id for the
invalid offscreen, thereby actually rendering the required parts.

Fixes the blend-invisible-child compare test

Current state for compare tests:
Ok:                 397
Expected Fail:      0
Fail:               26
Unexpected Pass:    0
Skipped:            2
Timeout:            0

2 years agovulkan: Convert blend shader
Benjamin Otte [Sun, 21 May 2023 02:42:02 +0000 (04:42 +0200)]
vulkan: Convert blend shader

Same work as crossfade shader pretty much.

2 years agovulkan: Update the cross-fade shader
Benjamin Otte [Sat, 20 May 2023 23:28:36 +0000 (01:28 +0200)]
vulkan: Update the cross-fade shader

This also fixes it rendering weird things when the bounds of start and
end node don't match.

2 years agovulkan: Implement bindless texture rendering
Benjamin Otte [Sat, 20 May 2023 00:56:02 +0000 (02:56 +0200)]
vulkan: Implement bindless texture rendering

Instead of having a descriptor set per operation, we just have one
descriptor set and bind all our images into it.

Then the shaders get to use an index into the large texture array
instead.

Getting this to work - because it's a Vulkan extension that needs to be
manually enabled, even though it's officially part of Vulkan 1.2 - is
insane.

2 years agovulkan: Clip using scissors
Benjamin Otte [Fri, 19 May 2023 03:35:18 +0000 (05:35 +0200)]
vulkan: Clip using scissors

If we have a rectangular clip without transforms, we can use
scissoring. This works particularly well because it allows intersecting
rounded rectangles with regular rectangles in all cases:
Use the scissor rect for the rectangle and the normal clipping code for
the rounded rectangle.

2 years agovulkan: Make scissoring an explicit operation
Benjamin Otte [Fri, 19 May 2023 01:08:43 +0000 (03:08 +0200)]
vulkan: Make scissoring an explicit operation

The idea is to use it for clip nodes when they are integer-aligned.

To do that, we need to track the scissor rect in the parse state, so we
do that, too.

Also move the viewport offset out of the projection matrix, as it is
part of the transform between clip and scissor, so it needs to live in
the offset.

2 years agovulkan: Remove unneeded struct member
Benjamin Otte [Thu, 18 May 2023 21:35:59 +0000 (23:35 +0200)]
vulkan: Remove unneeded struct member

We can use gsk_vulkan_pipeline_get_vertex_stride() whenever we need that
value.

2 years agovulkan: Bind vertex buffers only once
Benjamin Otte [Thu, 18 May 2023 21:34:27 +0000 (23:34 +0200)]
vulkan: Bind vertex buffers only once

We can index into the same buffer from every pipeline due to the aligned
buffer writes (see previous commit).

So we do that.

2 years agovulkan: Align vertex data
Benjamin Otte [Thu, 18 May 2023 21:22:25 +0000 (23:22 +0200)]
vulkan: Align vertex data

We align the data to a multiple of vertex stride, that way we use more
memory, but we could compute an offset into the vertex buffer without
changing the offset.

2 years agovulkan: Set offsets when counting
Benjamin Otte [Thu, 18 May 2023 21:10:16 +0000 (23:10 +0200)]
vulkan: Set offsets when counting

We can set the vertex offset while counting the data, this gets rid of
the need of passing all the counting machinery into the actual data
collection code.

2 years agovulkan: Simplify switch statement
Benjamin Otte [Thu, 18 May 2023 20:55:15 +0000 (22:55 +0200)]
vulkan: Simplify switch statement

All branches do the same thing now, so pull them all into the same
branch.

2 years agovulkan: Simplify collect_vertex_data()
Benjamin Otte [Thu, 18 May 2023 20:52:17 +0000 (22:52 +0200)]
vulkan: Simplify collect_vertex_data()

We don't have any size arguments to it, so don't use them.

2 years agovulkan: Remove a function from pipeline impls
Benjamin Otte [Thu, 18 May 2023 19:56:20 +0000 (21:56 +0200)]
vulkan: Remove a function from pipeline impls

That function is available already in the structs we feed to Vulkan.

Store it from there and reuse it.

2 years agovulkan: Don't draw fully clipped nodes
Benjamin Otte [Thu, 18 May 2023 01:03:10 +0000 (03:03 +0200)]
vulkan: Don't draw fully clipped nodes

... if they are container nodes. Other nodes will get culled by the
vertex shader.

2 years agovulkan: Add optimization for transforms
Benjamin Otte [Wed, 17 May 2023 23:18:38 +0000 (01:18 +0200)]
vulkan: Add optimization for transforms

When attempting a complex transform, check if the clip can be ignored
and do that if possible.

That way we don't cause fallbacks when transforming the clip is too
complex.

2 years agovulkan: Don't crash with overly large nodes
Benjamin Otte [Sun, 4 Jun 2023 17:16:04 +0000 (19:16 +0200)]
vulkan: Don't crash with overly large nodes

... when these nodes are used as children of a complex transform nodes
and we lose the clip.

2 years agovulkan: Update texture shader to do AA
Benjamin Otte [Mon, 15 May 2023 00:25:41 +0000 (02:25 +0200)]
vulkan: Update texture shader to do AA

2 years agovulkan: Split generic code off
Benjamin Otte [Mon, 15 May 2023 00:24:50 +0000 (02:24 +0200)]
vulkan: Split generic code off

No need to duplicate code in shaders when it can be shared.

2 years agovulkan: Use rounded rect APIs to improve clips
Benjamin Otte [Sun, 14 May 2023 23:56:10 +0000 (01:56 +0200)]
vulkan: Use rounded rect APIs to improve clips

There are a bunch of intersection APIs available these days.
Let's use them.

2 years agogsk: Add (private) gsk_rounded_rect_intersection()
Benjamin Otte [Sun, 14 May 2023 21:13:23 +0000 (23:13 +0200)]
gsk: Add (private) gsk_rounded_rect_intersection()

The idea is that for a rectangle intersection, each corner of the
result is either entirely part of one original rectangle or it is
an intersection point.

By detecting those 2 cases and treating them differently, we can
simplify the code to compare rounded rectangles.

2 years agovulkan: Set the initial clip rect
Benjamin Otte [Sun, 14 May 2023 02:15:06 +0000 (04:15 +0200)]
vulkan: Set the initial clip rect

Instead of rendering unclipped, set the clip region to the extents of
the current clip region.

2 years agovulkan: Only draw one rect
Benjamin Otte [Sun, 14 May 2023 02:12:14 +0000 (04:12 +0200)]
vulkan: Only draw one rect

Instead of emitting the render commands once per rectangle of the clip
region, just emit them once with the region's extents.

This is generally faster because it emits fewer commands to the GPU,
even though it may touch significantly more pixels.

For a proper method, we'd need to record the commands per clip rectangle
instead of emitting all of them all the time.

2 years agovulkan: Use CLAMP_TO_EDGE in sampler
Benjamin Otte [Sat, 13 May 2023 04:02:51 +0000 (06:02 +0200)]
vulkan: Use CLAMP_TO_EDGE in sampler

We don't want to clamp to the border, that causes fade-outs at the
edges.

2 years agovulkan: Rewrite AA shaders to respect scale
Benjamin Otte [Sat, 13 May 2023 01:14:16 +0000 (03:14 +0200)]
vulkan: Rewrite AA shaders to respect scale

The border and color shaders - the ones that do AA - now multiply their
coordinates by the scale factor, which gives them better rounding
capabilities.

This in particular improves the case where they are used in fractional
scaling situations, where the scale is defined at the root element.

2 years agovulkan: Don't allocate no descriptor sets
Benjamin Otte [Fri, 12 May 2023 20:19:37 +0000 (22:19 +0200)]
vulkan: Don't allocate no descriptor sets

If we don't need them, exit early.

Shuts up the validation layers when running simple denos without
textures.

2 years agovulkan: Only use a single pipeline layout
Benjamin Otte [Fri, 12 May 2023 18:49:31 +0000 (20:49 +0200)]
vulkan: Only use a single pipeline layout

There's no need to use 3 different ones when they are compatible.

2 years agovulkan: Don't cull vertices
Benjamin Otte [Fri, 12 May 2023 16:17:44 +0000 (18:17 +0200)]
vulkan: Don't cull vertices

We end up with the backside, when we scale(-1) and we still want it to
be visible, just flipped.

2 years agovulkan: Use scale factor for offscreens and fallbacks
Benjamin Otte [Fri, 12 May 2023 13:23:02 +0000 (15:23 +0200)]
vulkan: Use scale factor for offscreens and fallbacks

Previously, we just used the defaultscale factor, but now that we're
having it available in push constants, we can read it back for creating
offscreens and rendering fallbacks.

So do that.

2 years agovulkan: Split scale from matrix
Benjamin Otte [Fri, 12 May 2023 03:15:28 +0000 (05:15 +0200)]
vulkan: Split scale from matrix

Now, the scale is no longer part of the matrix. This allows shaders to
transform points by the scale which increases accuracy for antialiasing.

2 years agovulkan: Keep the modelview as a GskTransform
Benjamin Otte [Fri, 12 May 2023 02:18:59 +0000 (04:18 +0200)]
vulkan: Keep the modelview as a GskTransform

This allows doing more optimized math on it.

2 years agovulkan: Split modelview and projection
Benjamin Otte [Fri, 12 May 2023 02:09:13 +0000 (04:09 +0200)]
vulkan: Split modelview and projection

This is adding extra work, but the benefits should become visible
in future commits.

2 years agovulkan: Add scale to push constants
Benjamin Otte [Fri, 12 May 2023 01:59:44 +0000 (03:59 +0200)]
vulkan: Add scale to push constants

This way, it can be pushed to the shaders

2 years agovulkan: Move scale into the state object
Benjamin Otte [Fri, 12 May 2023 01:35:58 +0000 (03:35 +0200)]
vulkan: Move scale into the state object

2 years agovulkan: Add offset to the Vulkan clip checks
Benjamin Otte [Wed, 17 May 2023 23:18:30 +0000 (01:18 +0200)]
vulkan: Add offset to the Vulkan clip checks

This was forgotten when tracking the offset was added, so code was
actually selecting the wrong shaders.

2 years agovulkan: Move offset into the state object
Benjamin Otte [Fri, 12 May 2023 00:51:50 +0000 (02:51 +0200)]
vulkan: Move offset into the state object

2 years agovulkan: Add a new GskVulkanParseState
Benjamin Otte [Thu, 11 May 2023 21:38:12 +0000 (23:38 +0200)]
vulkan: Add a new GskVulkanParseState

It's a 1:1 replacement for GskVulkanPushConstants, just without the
indirection through a different file.

GskVulkanPushConstants as a struct is gone now.
The file still exists to handle the push_constants operation.

2 years agovulkan: Don't store push constants in RenderOp
Benjamin Otte [Thu, 11 May 2023 23:34:52 +0000 (01:34 +0200)]
vulkan: Don't store push constants in RenderOp

Instead, only store the values that are needed.

2 years agovulkan: Split out gsk_vulkan_render_pass_append_push_constants()
Benjamin Otte [Thu, 11 May 2023 20:09:12 +0000 (22:09 +0200)]
vulkan: Split out gsk_vulkan_render_pass_append_push_constants()

Simplifies the code and makes future refactoring easier

2 years agovulkan: Pass values to push directly
Benjamin Otte [Thu, 11 May 2023 19:36:44 +0000 (21:36 +0200)]
vulkan: Pass values to push directly

Don't require a GskVulkanPushConstants there.

2 years agovulkan: Add a static assert
Benjamin Otte [Wed, 10 May 2023 15:55:56 +0000 (17:55 +0200)]
vulkan: Add a static assert

We don't want to make the push constants larger than what the spec
guarantees. And that is 128 bytes, see value for
maxPushConstantsSize in table 55 of
https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#limits-minmax

2 years agovulkan: Handle clip properly for offscreens
Benjamin Otte [Thu, 11 May 2023 14:59:02 +0000 (16:59 +0200)]
vulkan: Handle clip properly for offscreens

This was broken in the last commit.

2 years agovulkan: Track offset in the renderpass
Benjamin Otte [Wed, 10 May 2023 14:40:22 +0000 (16:40 +0200)]
vulkan: Track offset in the renderpass

This avoids emitting lots of push constant updates as most of the
transforms we have are simple translations to adjust drawing for the
next widget.

2 years agovulkan: Pass scale to offscreens
Benjamin Otte [Wed, 10 May 2023 01:17:38 +0000 (03:17 +0200)]
vulkan: Pass scale to offscreens

Create offscreens with enough pixels for the given scale and ensure
the scale is passed on.

This improves text rendering on offscreens quite a bit.

2 years agovulkan: Clean up scale handling
Benjamin Otte [Wed, 10 May 2023 00:46:57 +0000 (02:46 +0200)]
vulkan: Clean up scale handling

1. Use a graphene_vec2_t
2. Ensure it's always positive
3. Don't break with fallback

The scale value is nothing more than an indication of how many pixels to
assume per unit of a node.

2 years agovulkan: Fix typo
Benjamin Otte [Wed, 10 May 2023 00:11:28 +0000 (02:11 +0200)]
vulkan: Fix typo

2 years agovulkan: Don't store unused matrices
Benjamin Otte [Tue, 9 May 2023 22:21:39 +0000 (00:21 +0200)]
vulkan: Don't store unused matrices

We can compute it when needed, so do that.

2 years agovulkan: Remove unneeded argument
Benjamin Otte [Tue, 9 May 2023 22:17:01 +0000 (00:17 +0200)]
vulkan: Remove unneeded argument

The initial matrix can be computed as needed, so we don't need to
precompute it.

2 years agovulkan: Don't explode without vertex data
Benjamin Otte [Tue, 9 May 2023 22:09:03 +0000 (00:09 +0200)]
vulkan: Don't explode without vertex data

If no buffer has any vertex data (read: if nothing gets drawn), don't
try to allocate a 0 bytes buffer.

2 years agovulkan: Handle empty child bounds in repeat node
Benjamin Otte [Tue, 9 May 2023 22:08:24 +0000 (00:08 +0200)]
vulkan: Handle empty child bounds in repeat node

Also add test to the testsuite for it.

2 years agovulkan: Fix repeat nodes
Benjamin Otte [Tue, 9 May 2023 21:50:13 +0000 (23:50 +0200)]
vulkan: Fix repeat nodes

2 years agovulkan: Don't transform the viewport rect
Benjamin Otte [Tue, 9 May 2023 21:48:44 +0000 (23:48 +0200)]
vulkan: Don't transform the viewport rect

We don't want to render the offscreen trnsformed, we want to render it
as-is.

We lose the correct scale factor, but that requires some separate work,
so for now it gets a bit blurry on hidpi.

2 years agovulkan: Make quarks global variables
Benjamin Otte [Tue, 9 May 2023 20:30:49 +0000 (22:30 +0200)]
vulkan: Make quarks global variables

I don't want to ensure there's a RenderPass available everywhere and
recreate the quarks in each, I just want to use them.

2 years agovulkan: Split out a function
Benjamin Otte [Tue, 9 May 2023 20:26:13 +0000 (22:26 +0200)]
vulkan: Split out a function

We can now create offscreens explicitly.

2 years agovulkan: offscreens are used as color attachments
Benjamin Otte [Tue, 9 May 2023 20:25:22 +0000 (22:25 +0200)]
vulkan: offscreens are used as color attachments

... so set the corresponding flag.

Also name the function "new_for_offscreen()" because thats what this
function is about, "texture" is ambiguous.

2 years agovulkan: compute new modelview directly
Benjamin Otte [Sun, 7 May 2023 08:07:02 +0000 (10:07 +0200)]
vulkan: compute new modelview directly

no need to go through a GskTransform

2 years agovulkan: Make border shader handle fractional widths
Benjamin Otte [Sun, 7 May 2023 01:41:38 +0000 (03:41 +0200)]
vulkan: Make border shader handle fractional widths

We were rounding widths properly, make sure we always round up.

2 years agovulkan: Don't round corners when growing rounded rect
Benjamin Otte [Sun, 7 May 2023 01:40:44 +0000 (03:40 +0200)]
vulkan: Don't round corners when growing rounded rect

If the corner is set to 0, keep it there.

2 years agovulkan: Rewrite rounded rectangle to use SDF distance
Benjamin Otte [Sat, 6 May 2023 23:49:29 +0000 (01:49 +0200)]
vulkan: Rewrite rounded rectangle to use SDF distance

We can use this to properly compute distance in scaled situations.
We also now compute coverage with (imperfect) antialiasing.

2 years agovulkan: Start rework on shaders to allow antialiased drawing
Benjamin Otte [Sat, 6 May 2023 23:06:52 +0000 (01:06 +0200)]
vulkan: Start rework on shaders to allow antialiased drawing

This introduces the rect object and adds a rect_distance() and
rect_coverage() function.

_distance() returns the signed distance tp the rectangle.
_coverage() returns the coverage of a pixel centered at that position.

Note that the pixel size is computed using dFdx/dFdy.

2 years agovulkan: Render whole texture
Benjamin Otte [Fri, 5 May 2023 07:29:47 +0000 (09:29 +0200)]
vulkan: Render whole texture

When the node bounds were a non-integer size, the texture would get
ceil()ed pixels, but various viewport or scissor computations might
floor() instead, leaving the right/bottom row of pixels untouched.
Make sure those functions ceil(), too.

2 years agorenderer: return_if_fail() if the given texture size is 0
Benjamin Otte [Sat, 20 May 2023 23:27:09 +0000 (01:27 +0200)]
renderer: return_if_fail() if the given texture size is 0

All renderers SEGV currently when that happens.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 4 Jun 2023 17:35:04 +0000 (17:35 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

wayland: Don't leak cursor structs

See merge request GNOME/gtk!6058

2 years agoUpdate Georgian translation
Ekaterine Papava [Sun, 4 Jun 2023 14:45:45 +0000 (14:45 +0000)]
Update Georgian translation

2 years agotestsuite: Improve test coverage
Matthias Clasen [Thu, 1 Jun 2023 00:35:17 +0000 (20:35 -0400)]
testsuite: Improve test coverage

2 years agowayland: Don't leak cursor structs
Matthias Clasen [Thu, 1 Jun 2023 00:34:28 +0000 (20:34 -0400)]
wayland: Don't leak cursor structs

Found by gcc's -fanalyzer.

2 years agoNEWS: Cosmetics
Matthias Clasen [Wed, 31 May 2023 21:13:05 +0000 (17:13 -0400)]
NEWS: Cosmetics

2 years agoMerge branch 'drop-x11-dnd-keynav' into 'main'
Matthias Clasen [Sat, 3 Jun 2023 19:38:24 +0000 (19:38 +0000)]
Merge branch 'drop-x11-dnd-keynav' into 'main'

x11: Stop using passive grabs

See merge request GNOME/gtk!6055

2 years agoRevert "gdk/x11: Also grab keyboard during XDnD grabs"
Matthias Clasen [Sat, 3 Jun 2023 16:17:55 +0000 (12:17 -0400)]
Revert "gdk/x11: Also grab keyboard during XDnD grabs"

This reverts commit ae94417f80c92b26792280a9b798cafc01e49232.

2 years agox11: Stop using passive grabs
Matthias Clasen [Sat, 3 Jun 2023 14:44:21 +0000 (10:44 -0400)]
x11: Stop using passive grabs

The keynav that this implements is half-broken under
xwayland anyway, and it confused and complicates things
on the compositor side.

2 years agoMerge branch 'wip/otte/fix-glx' into 'main'
Benjamin Otte [Sat, 3 Jun 2023 16:19:09 +0000 (16:19 +0000)]
Merge branch 'wip/otte/fix-glx' into 'main'

glx: Trap errors inside loop

Closes #5857

See merge request GNOME/gtk!6056

2 years agoglx: Trap errors inside loop
Benjamin Otte [Sat, 3 Jun 2023 16:00:56 +0000 (18:00 +0200)]
glx: Trap errors inside loop

Instead of trapping errors for the whole loop trying to create GL
contexts, trap them once per GL context.

Apparently GLX does throw an error when a too high version is requested
and doesn't just return NULL and then that error lingers when we try
lower versions.

Fixes #5857

2 years agoMerge branch 'wip/antoniof/boxlayout-baseline-optional' into 'main'
Matthias Clasen [Sat, 3 Jun 2023 11:01:40 +0000 (11:01 +0000)]
Merge branch 'wip/antoniof/boxlayout-baseline-optional' into 'main'

boxlayout: Don't always reserve height for baseline alignment

Closes #5863

See merge request GNOME/gtk!6053

2 years agoboxlayout: Don't always reserve height for baseline alignment
António Fernandes [Fri, 2 Jun 2023 19:18:56 +0000 (20:18 +0100)]
boxlayout: Don't always reserve height for baseline alignment

Otherwise an horizontal box may have a larger minumum height than
any of its children even though non of them is baseline-aligned.

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

2 years agoMerge branch 'trap-bad-rr-errors' into 'main'
Matthias Clasen [Fri, 2 Jun 2023 11:31:45 +0000 (11:31 +0000)]
Merge branch 'trap-bad-rr-errors' into 'main'

x11: Trap XRandr errors when getting outputs during init and update

See merge request GNOME/gtk!6046

2 years agoMerge branch 'for-main' into 'main'
Luca Bacci [Fri, 2 Jun 2023 09:34:48 +0000 (09:34 +0000)]
Merge branch 'for-main' into 'main'

GdkWin32 Cleanup

See merge request GNOME/gtk!5714

2 years agox11: Trap XRandr errors when getting outputs during init and update
Marco Trevisan (Treviño) [Thu, 1 Jun 2023 22:23:51 +0000 (00:23 +0200)]
x11: Trap XRandr errors when getting outputs during init and update

We may try to update the XRR outputs and Crtcs when they're changing in
the server, and so we may get BadRROutput that we're currently not
handling properly.

As per this, use traps and check whether we got errors, and if we did
let's ignore the current output.

It's not required to call init_randr13() again because if we got errors
it's very likely that there's a change coming that will be notified at
next iteration during which we'll repeat the init actions.

2 years agoMerge branch 'sumibi-yakitori/fix-glcontext-macos' into 'main'
Matthias Clasen [Thu, 1 Jun 2023 20:58:22 +0000 (20:58 +0000)]
Merge branch 'sumibi-yakitori/fix-glcontext-macos' into 'main'

macOS: Fix problems with OpenGL context creation on macOS

Closes #5811

See merge request GNOME/gtk!6044

2 years agoWindow: Copy caveats from :*visible to the setters
Daniel Boles [Thu, 1 Jun 2023 19:31:22 +0000 (20:31 +0100)]
Window: Copy caveats from :*visible to the setters

2 years agoWindow: Fix wrong case in property attribute which
Daniel Boles [Thu, 1 Jun 2023 19:26:57 +0000 (20:26 +0100)]
Window: Fix wrong case in property attribute which

rendered the literal text `org.gtk.MEthod.set_property focus-visible`.

2 years agoFix an issue where `min_version` was not being used as the minimum version required...
sumibi-yakitori [Thu, 1 Jun 2023 14:05:44 +0000 (23:05 +0900)]
Fix an issue where `min_version` was not being used as the minimum version required by GTK

2 years agoMerge branch 'wip/alice/muxer-fix' into 'main'
Matthias Clasen [Thu, 1 Jun 2023 10:54:33 +0000 (10:54 +0000)]
Merge branch 'wip/alice/muxer-fix' into 'main'

actionmuxer: Correctly notify actions after reparenting

Closes #5861

See merge request GNOME/gtk!6043

2 years agoFix a bug in error checking conditions. This avoids unintentional `Legacy` of the...
sumibi-yakitori [Thu, 1 Jun 2023 07:46:24 +0000 (16:46 +0900)]
Fix a bug in error checking conditions. This avoids unintentional `Legacy` of the created OpenGL context

2 years agoThe GL version reported by epoxy seems to depend on the current GL context, so the...
sumibi-yakitori [Thu, 1 Jun 2023 07:43:57 +0000 (16:43 +0900)]
The GL version reported by epoxy seems to depend on the current GL context, so the GL context to create should be the one determined by `gdk_gl_context_get_matching_version`

2 years agoactionmuxer: Correctly notify actions after reparenting
Alice Mikhaylenko [Thu, 1 Jun 2023 02:27:10 +0000 (06:27 +0400)]
actionmuxer: Correctly notify actions after reparenting

When registering an observer, we send a notification and for that we need
to query the action's state and param type. When setting up a muxer parent,
same thing happens, except the action is queried on the parent instead.

This means that the muxer will notify observers about the parent's actions,
but not about its own.

Add a test to verify it works.

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

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 31 May 2023 19:14:07 +0000 (19:14 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gsk: Support straight alpha textures

See merge request GNOME/gtk!6041

2 years agogltexturebuilder: Update the docs
Matthias Clasen [Wed, 31 May 2023 18:39:07 +0000 (14:39 -0400)]
gltexturebuilder: Update the docs

We do handle unpremultiplied alpha correctly (albeit
non-optimally) now.

2 years agogsk: Support straight alpha textures
Matthias Clasen [Wed, 31 May 2023 18:33:52 +0000 (14:33 -0400)]
gsk: Support straight alpha textures

This is not the optimal way of doing it: we're
reuploading the texture with client-side conversion.
But it fits nicely into our current handling of mipmaps.

We can do better once we use shaders for colorspace
conversions.

2 years agoMerge branch 'a11y-crash' into 'main'
Matthias Clasen [Wed, 31 May 2023 12:27:49 +0000 (12:27 +0000)]
Merge branch 'a11y-crash' into 'main'

label: Fix crashes when executing a11y actions

See merge request GNOME/gtk!6034

2 years agolabel: Fix crashes when executing a11y actions
Erik Schilling [Wed, 31 May 2023 12:27:48 +0000 (12:27 +0000)]
label: Fix crashes when executing a11y actions

2 years agoMerge branch 'more-texture-tests' into 'main'
Matthias Clasen [Wed, 31 May 2023 12:01:31 +0000 (12:01 +0000)]
Merge branch 'more-texture-tests' into 'main'

testsuite: Add more download tests

See merge request GNOME/gtk!6038

2 years agoGdkWin32: Remove unused functions
Luca Bacci [Tue, 30 May 2023 17:57:17 +0000 (19:57 +0200)]
GdkWin32: Remove unused functions