Commit Graph

79904 Commits

Author SHA1 Message Date
Benjamin Otte
9fe9ea34fd vulkan: Handle generating mipmaps for 1x1 images
Testcase included.
2024-04-08 21:06:54 +02:00
Matthias Clasen
f36f1b9829 Merge branch 'dmabuf-glarea' into 'main'
One approach to dmabufs in glarea

See merge request GNOME/gtk!7116
2024-04-07 17:24:33 +00:00
Matthias Clasen
2b09f5ea1e dmabuf: Reshuffle docs slightly
Move related parts together, for easier understanding.
2024-04-07 13:03:13 -04:00
Matthias Clasen
f51c82a2aa gtk-demo: Use offload for shadertoy
This is an easy way to verify that GtkGLArea delivers dmabufs
now, and it might have some practical uses to offload gl area.
2024-04-07 13:03:13 -04:00
Matthias Clasen
11d3be278d glarea: Return dmabuf textures
Export the GL texture as a dmabuf if we can, and provide the
texture in that form.
2024-04-07 13:03:13 -04:00
Benjamin Otte
cc98282caa Merge branch 'shortcutmanager-fix-phase-changes' into 'main'
shortcutmanager: Handle propagation phase changes of added controllers

Closes #6246

See merge request GNOME/gtk!7115
2024-04-07 15:45:51 +00:00
Matthias Clasen
85f2e1ccd8 Add gdk_dmabuf_texture_builder_set_dmabuf
Private utility api.
2024-04-07 11:12:13 -04:00
Matthias Clasen
91b98bc9e2 Add a private header
Just cosmetic reshuffling.
2024-04-07 11:12:13 -04:00
Matthias Clasen
704ee6a9d0 offload: Determine output transforms
When we look for the texture to attach to the subsurface, keep
track of transforms we see along the way, and look at their scale
component to determine if the texture needs to be flipped.
We currently don't allow rotations here.

This fixes glarea rendering being upside-down when offloaded.
2024-04-07 11:12:06 -04:00
Matthias Clasen
72e9f30937 subsurface: Add transforms
Allow to specify a D₂ transform when attaching a texture to a
subsurface, to handle flipped and rotated content. The Wayland
implementation handles these transforms by setting a buffer
transform on the subsurface.

All callers have been updated to pass GDK_TEXTURE_TRANSFORM_NORMAL.
2024-04-07 11:02:40 -04:00
Matthijs Velsink
aadaf4adf2 shortcutmanager: Track propagation phase of added controllers
GtkShortcutManager allows adding controllers to it. For the default
implementation, they get added to one of two models, based on the
propagation phase (either GTK_PHASE_CAPTURE or GTK_PHASE_BUBBLE).

However, when a controller is removed, its presence in the manager gets
checked against the current propagation phase of the controller, which
may have changed from when it was added. This can lead to crashes if the
controller was not disposed properly since it still has a reference in
one of the two models of the GtkShortcutManager.

To fix this, add a callback for `notify::propagation-phase`, which
removes the controller from all possible models and readds it again with
its current phase. This callback is only disconnected permanently when
the controller is manually removed with
`gtk_shortcut_manager_default_remove_controller()`.

Closes #6246
2024-04-07 16:29:08 +02:00
Yaron Shahrabani
d83ad6b505 Update Hebrew translation
(cherry picked from commit b19247e4ef)
2024-04-06 13:19:11 +00:00
Piotr Drąg
b647d1a58c Update Polish translation 2024-04-06 12:32:39 +02:00
Danial Behzadi
68cff3b108 Update Persian translation
(cherry picked from commit 58d48cd3e5)
2024-04-05 12:40:53 +00:00
Matthias Clasen
84846aace7 Merge branch 'matthiasc/for-main' into 'main'
wayland: Work around mutter deficiences

See merge request GNOME/gtk!7112
2024-04-05 09:47:34 +00:00
Athmane MOKRAOUI
7bd93730d1 Update Kabyle translation 2024-04-05 09:16:50 +00:00
Matthias Clasen
c5d05fdc88 wayland: Work around mutter deficiences
Add the environment variable NO_POINTER_VIEWPORT to force the use
of buffer scale for pointer surfaces. This is a temporary workaround
for https://gitlab.gnome.org/GNOME/mutter/-/issues/2633.
2024-04-05 11:13:24 +02:00
Asier Sarasua Garmendia
f6ff2cd1cb Update Basque translation
(cherry picked from commit e54ecf5e32)
2024-04-05 08:43:42 +00:00
Matthias Clasen
9b0060e84d Merge branch 'matthiasc/for-main' into 'main'
Bump the cairo dep

See merge request GNOME/gtk!7110
2024-04-05 08:00:56 +00:00
Matthias Clasen
8d5633cb88 Drop code handling old cairo
We require cairo 1.18 now, so know that we will get subpixel
positioning for text, and have a little less uncertainty in
our font rendering.
2024-04-05 09:00:22 +02:00
Matthias Clasen
f74b1d48b6 Merge branch 'update-gtkswitch-state-docs' into 'main'
docs: Clarify state and active properties in GtkSwitch

Closes #6600

See merge request GNOME/gtk!7109
2024-04-05 06:57:16 +00:00
Matthias Clasen
27ebf756fe Bump the cairo dep
Require cairo 1.18, now that we have this stable release.
2024-04-05 08:01:39 +02:00
Dylan McCall
631da2e723
docs: Clarify state and active properties in GtkSwitch
Remove duplicate descriptions of the switch's appearance, describe more
particularly how the default signal handler for `GtkSwitch::state-set`
behaves, and add a suggestion that the `state` property should
only be set when communicating a delayed state change.

Fixes #6600
2024-04-04 20:29:07 -07:00
Matthias Clasen
b5531d3d6f Merge branch 'michaelweghorn/a11y_atspi_getcharacterextents_getoffsetatpoint_fixes' into 'main'
a11y atspi: Misc fixes for AT-SPI Text methods GetCharacterExtents, GetRangeExtents and GetOffsetAtPoint

See merge request GNOME/gtk!7104
2024-04-04 22:28:50 +00:00
Martin
5e6bc41fdd Update Slovenian translation 2024-04-04 22:15:05 +00:00
Matthias Clasen
d0581af2af Merge branch 'matthiasc/for-main' into 'main'
printing: Add context to some strings

See merge request GNOME/gtk!7107
2024-04-04 16:15:30 +00:00
Artur S0
cec746804d Update Russian translation 2024-04-04 15:36:42 +00:00
Matthias Clasen
ade1aaa8be printing: Add context to some strings
The job priority strings need context to disambiguate them from
similar short strings elsewhere.
2024-04-04 16:56:50 +02:00
Matthias Clasen
345d23898d Merge branch 'matthiasc/for-main' into 'main'
Add context to some translatable strings

Closes #6609

See merge request GNOME/gtk!7105
2024-04-04 14:38:06 +00:00
Matthias Clasen
415717276a Merge branch 'fix-spinbutton-updates' into 'main'
Revert "spinbutton: Tangential refactoring, small fix"

Closes #6599

See merge request GNOME/gtk!7103
2024-04-04 13:27:56 +00:00
Matthias Clasen
cebe640bce Add context to some translatable strings
This was requested by Alexandre Franke.

Fixes: #6609
2024-04-04 15:25:07 +02:00
Emmanuele Bassi
73084b761f Apply code style fixes from review 2024-04-04 13:05:24 +00:00
Athmane MOKRAOUI
eb13ecfbe7 Update Kabyle translation 2024-04-04 12:13:23 +00:00
Matthias Clasen
85c4507609 spinbutton: Fix a corner case
Fix a bug where a zero increment would make the value unsettable,
when the more natural operation is to allow any value to be set.
2024-04-04 14:11:10 +02:00
Matthias Clasen
fcb6c8e447 Revert "spinbutton: Tangential refactoring, small fix"
This reverts commit 3d898af736.

The commit caused a regression where, depending on the update policy,
we would not apply value changes at all.

Fixes: #6599
2024-04-04 14:00:25 +02:00
Michael Weghorn
0b27f39c2b a11y atspi: Don't require GtkWidget for GetOffsetAtPoint
Use the existing `gtk_at_spi_translate_coordinates_to_accessible`
to translate the coordinates passed as parameters to AT-SPI
Text's GetOffsetAtPoint method instead of having a
custom GtkWidget-specific translation.

This makes this work for non-GtkWidget GtkAccessibles
as well, and also adds support for parent-relative
coordinates (ATSPI_COORD_TYPE_PARENT).
2024-04-04 13:53:49 +02:00
Michael Weghorn
2101f880af a11 atspi: Fix type for GetOffsetAtPoint result
With the fix from the previous commit in place,
trying to use the GetOffsetAtPoint AT-SPI Text method
from Accerciser's IPython console with the gtk4-demo
Hypertext example would still give this error:

    In [46]: acc.queryText().getCharacterExtents(5, pyatspi.XY_WINDOW)
    Out[46]: (58, 20, 5, 19)
    In [47]: acc.queryText().getOffsetAtPoint(59, 21, pyatspi.XY_WINDOW)
    ---------------------------------------------------------------------------
    Error                                     Traceback (most recent call last)
    Cell In[47], line 1
    ----> 1 acc.queryText().getOffsetAtPoint(59, 21, pyatspi.XY_WINDOW)

    File /usr/lib/python3/dist-packages/pyatspi/text.py:346, in Text.getOffsetAtPoint(self, x, y, coordType)
        331 def getOffsetAtPoint(self, x, y, coordType):
        332         """
        333         Get the offset of the character at a given onscreen coordinate.
        334         The coordinate system used to interpret x and y is determined
       (...)
        344         -1 if the point is outside the bounds of any glyph.
        345         """
    --> 346         return Atspi.Text.get_offset_at_point(self.obj, x, y, coordType)

    Error: atspi_error: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. (1)

and the gtk4-demo output would show the actual problem:

    (gtk4-demo:563491): GLib-GIO-WARNING **: 13:18:27.652: Type of return value is incorrect: expected '(i)', got '(u)'

Fix this by returning an int as expected.

With this in place, the result is now as expected:

    In [48]: acc.queryText().getCharacterExtents(5, pyatspi.XY_WINDOW)
    Out[48]: (58, 20, 5, 19)
    In [49]: acc.queryText().getOffsetAtPoint(59, 21, pyatspi.XY_WINDOW)
    Out[49]: 5
2024-04-04 13:52:28 +02:00
Michael Weghorn
2cc241732d a11y atspi: Fix input variant type for Text's GetOffsetAtPoint
Trying to use the AT-SPI Text GetOffsetAtPoint method
didn't work.

For example, trying to use it from Accerciser's IPython
console with the gtk4-demo Hypertext example, would
give this error:

    In [45]: acc.queryText().getOffsetAtPoint(59, 21, pyatspi.XY_WINDOW)
    ---------------------------------------------------------------------------
    Error                                     Traceback (most recent call last)
    Cell In[45], line 1
    ----> 1 acc.queryText().getOffsetAtPoint(59, 21, pyatspi.XY_WINDOW)

    File /usr/lib/python3/dist-packages/pyatspi/text.py:346, in Text.getOffsetAtPoint(self, x, y, coordType)
        331 def getOffsetAtPoint(self, x, y, coordType):
        332         """
        333         Get the offset of the character at a given onscreen coordinate.
        334         The coordinate system used to interpret x and y is determined
       (...)
        344         -1 if the point is outside the bounds of any glyph.
        345         """
    --> 346         return Atspi.Text.get_offset_at_point(self.obj, x, y, coordType)

    Error: atspi_error: Unsupported coordinate space (1)

and the gtk4-demo output would show the actual problem:

    (gtk4-demo:562820): GLib-CRITICAL **: 13:14:10.862: the GVariant format string '(i&s)' has a type of '(is)' but the given value has a type of '(iiu)'

    (gtk4-demo:562820): GLib-CRITICAL **: 13:14:10.863: g_variant_get: assertion 'valid_format_string (format_string, TRUE, value)' failed

Specify the proper type, which gets us one step further at least.
2024-04-04 13:50:13 +02:00
Michael Weghorn
c01782b0a9 a11y atspi: Reuse helper to translate text coords
Instead of reimplementing translating coordinates
relative to a GtkAccessible in a way that requires
that the GtkAccessible is a GtkWidget, reuse the
existing helper function
`gtk_at_spi_translate_coordinates_from_accessible`
in the implementations of AT-SPI Text methods
GetCharacterExtents and GetRangeExtents.

This makes the implementation work for non-GtkWidget
GtkAccessibles, adds support for parent-relative
coordinates (ATSPI_COORD_TYPE_PARENT)
and also fixes an issue with incorrect extents
being reported in a quick test with the "Hypertext"
sample from gtk4-demo.

Sample for querying extents in Accerciser's IPython
console for the Hypertext sample previously gave this
result:

    In [39]: acc.queryText().getCharacterExtents(5, pyatspi.XY_WINDOW)
    Out[39]: (58, 20, -53, -1)

Now, a positive width and height are returned as expected and
the result matches the one when using the GTK 3 version
in gtk3-demo:

    In [1]: acc.queryText().getCharacterExtents(5, pyatspi.XY_WINDOW)
    Out[1]: (58, 20, 5, 19)
2024-04-04 13:50:13 +02:00
Michael Weghorn
a62831562f a11y atspi: Move helpers for coord translation to gtkatspiutils
Move the (so far) local helper functions used for the
AT-SPI Component method implementations,
`translate_coordinates_from_accessible` and
`translate_coordinates_to_accessible` to
`gtkatspiutilsprivate` and add a "gtk_at_spi_"
prefix to the function names.

This will allow to reuse them elsewhere in
upcoming commits.
2024-04-04 13:50:06 +02:00
Matthias Clasen
40dd81e1a4 Merge branch 'drop-redundant-a11y-code' into 'main'
a11y: Drop the per-widget text implementations

See merge request GNOME/gtk!6924
2024-04-04 10:03:15 +00:00
Matthias Clasen
a9f3a52c18 Drop some per-widget a11y text implementations
We still keep the editable implementation, since not all our
editable widgets implement GtkAccessibleText yet, but the label,
inscription and textview implementations are unused.
2024-04-04 10:14:46 +02:00
Matthias Clasen
0978912922 Merge branch 'macos-color-picker' into 'main'
macos: color picker

Closes #5137

See merge request GNOME/gtk!7099
2024-04-04 06:56:08 +00:00
Matthias Clasen
3c9923d395 Merge branch 'a11y-text-work' into 'main'
a11y: Implement GetOffsetAtPoint

See merge request GNOME/gtk!7004
2024-04-04 05:31:17 +00:00
Matthias Clasen
0296f49eb0 Merge branch 'dynamic-cursor' into 'main'
gdk: Add dynamic cursors

See merge request GNOME/gtk!7067
2024-04-04 05:30:54 +00:00
Matthias Clasen
4b7a550366 Merge branch 'bump-pango-dep' into 'main'
Bump the pango dep

Closes #6554

See merge request GNOME/gtk!7100
2024-04-04 05:29:56 +00:00
Matthias Clasen
37e18b784e gtk-demo: Add a callback cursor
Make one of the GTK logo cursors in the cursors demo use a callback
cursor that follows the cursor theme size, to show that that is
possible.
2024-04-04 01:07:28 +02:00
Matthias Clasen
1275a2cb8d wayland: Use a viewport for pointer surfaces
This should give us more flexibility for buffer size vs surface
size.

Unfortunately, mutter doesn't play along currently, so this is
only useful for kwin, weston or sway.
2024-04-04 01:07:28 +02:00
Matthias Clasen
67a6f343a0 wayland: Keep pointer_output_scale as double
We can round up to the next integer when we need to.
2024-04-04 01:07:28 +02:00
Matthias Clasen
a98e6bff85 Add a test app
This app has a dynamic cursor that is the GTK logo, loaded from
an SVG to make it come out at the nominal size of the cursor
theme, while taking fractional scaling into account.
2024-04-04 01:07:28 +02:00