Commit Graph

81987 Commits

Author SHA1 Message Date
Juan Pablo Ugarte
c5a2cbcc70 gtk/gtkaccessiblevalue.c: Fix GTK_ACCESSIBLE_RELATION_SET_SIZE collect_rels value 2024-10-23 08:06:27 -04:00
Jordan Petridis
821e8289d4 gtkcssprovider: Use g_file_peek_path to get the uri for the sysprof marker
This avoids an extra allocation.

Additionally avoid calling it if file is already null.
2024-10-23 08:06:02 -04:00
Daniel Șerbănescu
b0b1d7a928 Update Romanian translation 2024-10-21 16:55:51 +00:00
Віктар Гаўрылавец
3a1cf43028 Update Belarusian translation 2024-10-18 09:16:52 +00:00
Andi Chandler
fa2f49ee7c Update British English translation 2024-10-17 13:07:39 +00:00
Rūdolfs Mazurs
5cefdf58a1 Update Latvian translation 2024-10-13 13:53:13 +00:00
Matthias Clasen
68eb82a028 Merge branch 'ebassi/issue-7069-backport' into 'gtk-4-16'
gtk/accessibletext: handle NULL default values

See merge request GNOME/gtk!7815
2024-10-09 10:39:20 +00:00
Christian Hergert
65eee73e82 gtk/accessibletext: handle NULL default values
The default implementation for get_default_attributes() returns NULL for
both names and values yet the code which iterates them is assuming they
will never be NULL.

Since the interface implies that if the values are set, they will return
valid strings, make the default implementation do that.

Fixes: #7069
(cherry picked from commit ab1c85830c)
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2024-10-08 19:13:27 +01:00
Luca Bacci
861f9875ac Merge branch 'backport-mr-7776' into 'gtk-4-16'
WGL: Avoid using swap exchange on NVidia drivers [gtk-4-16]

See merge request GNOME/gtk!7811
2024-10-08 15:23:56 +00:00
Luca Bacci
03fa775407 WGL: Avoid using swap method exchange on NVidia drivers
It seems that NVidia sets PFD_SWAP_EXCHANGE / WGL_SWAP_EXCHANGE_ARB
on pixel formats but doesn't guarantee that the backbuffer age is
constantly 2. My guess is that they use swap exchange only to signal
usage of a flip present method.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/7019
2024-10-08 12:41:10 +02:00
Matthias Clasen
15358d0d5e Merge branch 'backports-for-4-16' into 'gtk-4-16'
gpu: Remove warning

See merge request GNOME/gtk!7808
2024-10-07 18:28:39 +00:00
Benjamin Otte
d1725291a1 picture: Queue a redraw when not resizing
When changing the code to do the resize only when the size changed, I
forgot to queue a draw when the size did not change.

Fixes: 5031f30f28
Related: !7786
2024-10-07 11:48:02 -04:00
Benjamin Otte
b277d9a555 gpu: Remove warning
The warning gets triggered by rounding errors.

In particular when using fractional scales, the final tile may end up
not accurately matching the computed final value (in the example I was
debugging it was computing 1 vs 1.00000036 for the final tile index,
but that result computed a 0px wide tile size.
And for that tile size we hit that exit condition.
2024-10-07 11:47:55 -04:00
Matthias Clasen
96fbaa07e8 Post-release version bump 2024-10-04 12:52:13 -04:00
Matthias Clasen
65ba22f8ae 4.16.3 2024-10-04 11:31:45 -04:00
Matthias Clasen
7d5157e99b gstreamer: Fix gl context creation
We may not have a surface (since realizing media streams is optional),
so use the display when creating a gl context.
2024-10-04 11:30:19 -04:00
Matthias Clasen
4f0ac05b16 Merge branch 'gstreamer-no-gl-4-16' into 'gtk-4-16'
Fix testsuite setup

See merge request GNOME/gtk!7794
2024-10-04 15:14:11 +00:00
Matthias Clasen
6ad0cc7399 Merge branch 'backports-for-4-16' into 'gtk-4-16'
Fix testsuite setup

See merge request GNOME/gtk!7792
2024-10-04 14:40:37 +00:00
Matthias Clasen
503534df00 Merge branch 'cherry-pick-06f08ea8' into 'gtk-4-16'
[gtk-4-16] atcontext: Only recurse parents for non-widget accessibles

See merge request GNOME/gtk!7795
2024-10-04 14:26:00 +00:00
Matthias Clasen
a7f342d202 gstreamer: Tweak gl context handling
Just create the context when it is needed.
2024-10-04 09:56:44 -04:00
Matthias Clasen
ac9bf2f773 gstreamer: Simplify
Add a uses-gl property to our sink implementation, and use
it in the paintable code. This avoids juggling a second gl
context, with the risk of leaking it.
2024-10-04 09:56:44 -04:00
Matthias Clasen
3367a6209b gstreamer: Improve caps handling
Separate out the caps for dmabuf, gl and memory and add them
when appropriate.
2024-10-04 09:56:44 -04:00
Matthias Clasen
3cbb4aeb19 Restructure gtk_gst_paintable_video_renderer_create_video_sink
This code had too many early exits and was leaking GL contexts
and Gstreamer elements. Simplify.
2024-10-04 09:56:44 -04:00
Matthias Clasen
0128aa9ead gstreamer: Use the default display if needed
Calling gtk_media_stream_realize is not mandatory, but we can
still try to make dmabufs happen. Tested by removing the realize
call from GtkVideo and using GDK_DISABLE=gl.
2024-10-04 09:56:44 -04:00
Matthias Clasen
24f2540ba5 gstreamer: Restructure gtk_gst_sink_propose_allocation
Split this clearly into two cases: dmabuf or gl memory.
2024-10-04 09:56:44 -04:00
Matthias Clasen
d13303496f gstreamer: Make dmabufs work without GL
We only need a display to negotiate dmabuf formats. Pass that
directly, instead of getting the display of the GL context as
we did so far.

With this,

GSK_RENDERER=vulkan GL_DISABLE=gl gtk4-demo --run video_player

still uses dmabufs.

Related: #7048
2024-10-04 09:56:44 -04:00
Georges Basile Stavracas Neto
2847fdd36f atcontext: Only recurse parents for non-widget accessibles
The original intent was to only realize parents recursively for
non-widget accessible objects. The implementation, however, always
try to realize parents. In the case of GtkStackPage, which is a
non-widget accessible with a widget accessible child, this breaks.

Only realize non-widget accessible parents recursively if the
current accessible is not a widget as well.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/7058
Fixes 6074a18e3e


(cherry picked from commit 06f08ea804)
2024-10-04 13:22:19 +00:00
Matthias Clasen
c042b3bf83 ci: Stop using catch
It is useful to track down mysterious crashes in ci, but it causes
sporadic test failures, so disable it for now, until we have another
mysterious crash.
2024-10-03 21:35:26 -04:00
Benjamin Otte
289aa4553f picture: Only queue_resize() if necessary
When setting a new paintable, we don't need to queue_resize() when it's
the same size as the old paintable.

This is especially useful when pictures are used in a listview or
gridview and different rows display images of the same size.
2024-10-03 21:35:26 -04:00
Sergey Bugaev
c785deacd2 window: Fix crash when unexporting unrealized window
It is possible that the window gets unrealized while a handle to its
surface is exported. This, naturally, invalidates the handle, so there
is nothing left to unexport. We should just note that and do nothing,
rather than crashing.

Fixes a crash when a portal-backed file dialog parented to a window is
closed after the window it was parented to.

Reported-by: Ivan Molodetskikh <yalterz@gmail.com>
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2024-10-03 21:35:26 -04:00
Sergey Bugaev
78ffc7cefb window: Fix a typo
Fortunately, it didn't impact string length.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2024-10-03 21:35:26 -04:00
Sergey Bugaev
6f44be847f scrolledwindow: Fix measuring non-overlay, always visible scrollbars
The last part of logic in gtk_scrolled_window_measure () that accounted
for scrollbars was handling the hscrollbar first, and vscrollbar second.
For each of them, it looked at the orientation we're being measured in,
and either added or MAX'ed scrollbar's size request into ours (or not,
depending on scrollbar policy and whether overlay scrolling is used).

In case of GTK_ORIENTATION_HORIZONTAL, this resulted in

    // MAX in hscrollbar width.
    minimum_req = MAX (minimum_req, min_scrollbar_width + sborder.left + sborder.right);
    // Add in vscrollbar width.
    minimum_req += min_scrollbar_width;

whereas for GTK_ORIENTATION_VERTICAL, it was

    // Add in hscrollbar height.
    minimum_req += min_scrollbar_height;
    // MAX in vscrollbar height.
    minimum_req = MAX (minimum_req, min_scrollbar_height + sborder.top + sborder.bottom);

The former is correct and the latter is wrong: we should be adding the
size requests of the scrollbars together, and MAX'ing them with the
content size request.

Fix this by refactoring the logic to first handle the MAX'ing, and then
the addition.

This fixes the following criticals:

Gtk-CRITICAL **: 17:26:51.406: Allocation height too small. Tried to allocate 15x31, but GtkScrollbar 0x2a00fac0 needs at least 15x46.

that were happening when all of:
- scrollbar policy was set to ALWAYS,
- overlay scrolling was disabled,
- the scrollable child was really small.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2024-10-03 21:35:26 -04:00
Matthias Clasen
3424b80ef1 Fix testsuite setup
We no longer say GDK_DEBUG=gl-prefer-gl, we say GDK_DISABLE=gles-api.
2024-10-03 21:35:26 -04:00
Matthias Clasen
5cf0d4f7fd Merge branch 'gbsneto/backport-a11y' into 'gtk-4-16'
[gtk-4-16] atcontext: Always realize non-widget accessibles

See merge request GNOME/gtk!7789
2024-10-04 01:27:20 +00:00
Georges Basile Stavracas Neto
f916d82280 atcontext: Always realize non-widget accessibles
Upon joining the a11y tree. And do so recursively, as long as the parent
is also not a widget.

As for the explanation, please grab a mug of your favorite drink. It's
a little complicated.

GTK realizes AT contexts in 3 situations:

 1. When it's a toplevel, it's realized unconditionally
 2. When the widget is focused
 3. When the accessible is appended to a realized parent

Most importantly, GTK lazily realizes accessibles, and does not realize
child accessibles recursively.

Clearly, conditions 1 and 2 only ever happen for GtkWidgets, which are
accessible objects themselves. These two conditions will handle the vast
majority of cases of apps and platform libraries.

However, there are non-widget accessibles out there. GTK itself offers a
non-widget accessible implementation - GtkAtspiSocket - which is used by
WebKitGTK.

Now, let's look at WebKitGTK use case. It'll demonstrate the problem
nicely.

WebKitGTK creates the GtkAtspiSocket object *after* loading most of the
page. At this point, there are 2 possibilities:

 1. The web view widget is focused. In this case, the AT context of the
    web view is realized, and GTK will realize the GtkAtspiSocket when
    it is added to the a11y tree (condition 3 above).

 2. The web view widget is *not* focused. At some point the user focuses
    the web view, and GTK will realize the AT context of the web view.
    But remember, GTK does not realize child accessibles! That means
    GtkAtspiSocket won't be realized.

This example demonstrates a general problem with non-widget accessibles:
non-widget accessibles cannot trigger conditions 1 and 2, so they're
never realized. The only way they're realized in if they happen to be
added to an already realized accessible (condition 3).

To fix that, the following is proposed: always realize non-widget
accessibles, and also of their non-widget accessible parents. This is
not ideal, of course, as it might generate some D-Bus chattery, but GTK
does not have enough information to realize these objects at more
appropriate times.
2024-10-03 08:44:37 -03:00
Georges Basile Stavracas Neto
7d0cb2f006 atcontext: Factor out some code
Move the code that realizes an AT context if the parent is realized,
into to a separate function. This will make the next patch easier to
read.

No functional changes.
2024-10-03 08:44:37 -03:00
Matthias Clasen
c2417dc107 Merge branch 'default-cursor-xdg-gtk-4-16' into 'gtk-4-16'
wayland: Look for default cursor theme in XDG directories

See merge request GNOME/gtk!7767
2024-09-30 14:51:18 +00:00
Ilya Fedin
d4202b836a wayland: Look for default cursor theme in XDG directories
Currently it's looked up only in /usr/share what is a problem for non-FHS distros like NixOS
2024-09-30 15:50:29 +04:00
Anders Jonsson
82f08089f1 Update Swedish translation 2024-09-29 22:16:03 +00:00
Juliano de Souza Camargo
1610ecbbac Update Brazilian Portuguese translation 2024-09-29 16:29:55 +00:00
Matthias Clasen
b0048df3c6 Merge branch 'clear-settings-portal-gtk-4-16' into 'gtk-4-16'
wayland: Clear settings_portal when going to fallback with no portal settings

See merge request GNOME/gtk!7759
2024-09-29 13:25:02 +00:00
Matthias Clasen
b6370e1b0c Merge branch 'default-cursor-size-gtk-4-16' into 'gtk-4-16'
wayland: Use the same default cursor size as gsettings schema

See merge request GNOME/gtk!7758
2024-09-29 01:13:00 +00:00
Fran Dieguez
8360bfc772 Update Galician translation 2024-09-28 21:50:17 +00:00
Ilya Fedin
5670fea30d wayland: Clear settings_portal when going to fallback with no portal settings
All other code paths with goto fallback clear it, this makes the behavior consistent with them
2024-09-28 16:58:17 +04:00
Ilya Fedin
fabe179dab wayland: Use the same default cursor size as gsettings schema
Fixes: #7043
2024-09-28 16:57:40 +04:00
Matthias Clasen
630699fb68 Post-release version bump 2024-09-24 08:37:11 +02:00
Matthias Clasen
3f4a414b1d 4.16.2 2024-09-24 08:14:26 +02:00
Matthias Clasen
4569b1ab40 Merge branch '5917-stack-sidebar-object-ref' into 'main'
stack-sidebar: Hold reference to page

Closes #5917

See merge request GNOME/gtk!6144
2024-09-23 20:51:06 +00:00
Peter Bloomfield
a484e8fc37 stack-sidebar: Hold reference to page 2024-09-23 20:51:05 +00:00
Matthias Clasen
d51bf6d905 Merge branch 'fix-gl-texture-leak' into 'main'
gsk: Don't leak gl textures

Closes #7013

See merge request GNOME/gtk!7725
2024-09-23 20:50:30 +00:00