Commit Graph

81956 Commits

Author SHA1 Message Date
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
Matthias Clasen
358b0b4d13 Merge branch 'wip/state-driven-controller-changes' into 'main'
gtkwidget: Check for destroyed controllers while propagating state

Closes #6924

See merge request GNOME/gtk!7668
2024-09-23 20:45:01 +00:00
Daniel
8648a67c10 Updated Spanish translation 2024-09-23 09:39:29 +02:00
Matthias Clasen
f9b3ce95c2 Merge branch 'inspector-clipboard-criticals' into 'main'
inspector: Avoid criticals in the clipboard code

Closes #7026

See merge request GNOME/gtk!7730
2024-09-22 08:45:08 +00:00
Matthias Clasen
c828813d78 Merge branch 'not-a-mimetype-no-no' into 'main'
wayland: Be more careful with mimetypes

See merge request GNOME/gtk!7729
2024-09-22 08:43:44 +00:00
Matthias Clasen
5935dc174f inspector: Avoid criticals in the clipboard code
We keep a pointer to the GdkDrop object without a reference, and
then it dies on us. Be more careful, and clean up the dnd section
when the we drop object goes away.

Fixes: #7026
2024-09-22 09:58:31 +02:00
Matthias Clasen
b623b2acef wayland: Be more careful with mimetypes
Sometimes, jokers send us 'mimetypes' like DELETE or
org.webkitgtk.WebKit.custom-pasteboard-data, and gdk_intern_mime_type
will return NULL for such things. Handle that by just closing the fd.

Better than running into an assertion further down.
2024-09-22 09:25:44 +02:00
Yaron Shahrabani
cc867eeccf Update Hebrew translation 2024-09-21 19:39:39 +00:00
Benjamin Otte
17bdb4c8fb Merge branch 'wip/otte/for-main' into 'main'
wayland: Don't call gdk_display_sync()

Closes #7022 and #7025

See merge request GNOME/gtk!7726
2024-09-21 17:01:19 +00:00
Matthias Clasen
9ded3e64a2 Merge branch 'fix-rtl-centered-labels' into 'main'
Fix centered text in labels

Closes #6836

See merge request GNOME/gtk!7724
2024-09-21 16:39:42 +00:00
Benjamin Otte
60b1496091 wayland: Don't call gdk_display_sync()
It is not necessary.
Worse, it is reentrant and causes all sorts of avoc when processing
events halfway through initializing the context.

It only exists because in commit 3887548 the Wayland Vulkan code
was copy/pasted from X11.

Fixes #7022
Fixes #7025
2024-09-21 18:18:29 +02:00
Matthias Clasen
dc1b2d4117 gsk: Don't leak gl textures
We need to fix all the textures we own. This broke in 65c8320a.

Fixes: #7013
2024-09-21 10:51:26 +02:00
Matthias Clasen
e205f13495 Fix centered text in labels
When the text is rtl, pango will put the text at the right end of
its given width, causing the logical.x to be big, and in turn, our
computed position to be negative. If we don't allow that, centered
text will end up at the right side if it is rtl.

Fixes: #6836
2024-09-21 10:06:33 +02:00
Benjamin Otte
72718b7193 Merge branch 'wip/otte/critical-warning' into 'main'
vulkan: Demote g_critical() to g_warning()

See merge request GNOME/gtk!7723
2024-09-20 22:54:18 +00:00
Benjamin Otte
db95e37e15 vulkan: Demote g_critical() to g_warning()
For VK_DEBUG_REPORT_WARNING_BIT_EXT we should always have used
g_warning().

For VK_DEBUG_REPORT_ERROR_BIT_EXT g_critical() is technically the right
choice, but Mesa has been using this flag for normal warnings, so until
that gets fixed, we don't want to throw criticals.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31292
Fixes: !7020
2024-09-20 23:02:15 +02:00
Juliano de Souza Camargo
f9714cc054 Update Brazilian Portuguese translation 2024-09-20 00:03:31 +00:00
Ekaterine Papava
58c49ce6b0 Update Georgian translation 2024-09-19 23:03:39 +00:00
Florian Heiser
13364cea74 Update German translation 2024-09-19 08:25:48 +00:00
Andika Triwidada
f6014bdc08 Update Indonesian translation 2024-09-19 01:05:51 +00:00
Hugo Carvalho
6070edfa61 Update Portuguese translation 2024-09-18 21:52:59 +00:00
Emin Tufan Çetin
0600357373 Update Turkish translation 2024-09-18 07:05:11 +00:00
Yuri Chornoivan
7873ebac2a Update Ukrainian translation 2024-09-18 06:39:12 +00:00
Luming Zh
8edd376ab8 Update Chinese (China) translation 2024-09-18 01:21:37 +00:00
Piotr Drąg
6f300557bf Update Polish translation 2024-09-17 18:44:48 +02:00
Martin
bcda071d7d Update Slovenian translation 2024-09-17 15:22:00 +00:00
Jordi Mas i Hernandez
9df3a50c87 Update Catalan translation 2024-09-17 10:45:22 +00:00
Danial Behzadi
70d41583b3 Update Persian translation 2024-09-17 10:32:44 +00:00
Matthias Clasen
a50df37d52 Merge branch 'iss-5072' into 'main'
gtk/print/gtkprintoperation{,-unix,-portal}.c: add CAIRO_HAS checks

Closes #5072

See merge request GNOME/gtk!7717
2024-09-17 10:05:18 +00:00
Matthias Clasen
b7d07ae190 Merge branch 'dmabuf-init-refactor' into 'main'
Refactor dmabuf initialization

See merge request GNOME/gtk!7714
2024-09-17 09:56:25 +00:00
Thomas Devoogdt
3610ac0fd1
gsk/gskrendernodeparser.c: add CAIRO_HAS check
resolves #5072

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2024-09-17 10:55:41 +02:00
Thomas Devoogdt
9f855eecb1
modules/printbackends/gtkprintbackendfile.c: add CAIRO_HAS checks
This is similar to the checks in tools/gtk-rendernode-tool-render.c.

resolves #5072

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2024-09-17 10:55:40 +02:00
Thomas Devoogdt
ffc8f34dfd
gtk/print/gtkprintoperation{,-unix,-portal}.c: add CAIRO_HAS checks
This is similar to the checks in tools/gtk-rendernode-tool-render.c.

resolves #5072

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2024-09-17 10:55:39 +02:00