Commit Graph

79990 Commits

Author SHA1 Message Date
g.willems
f886aa3ac3 progressbar: fix highlight clipping
Clipping using OVERFLOW_HIDDEN relies on widget's padding box.
This prevents the highlight to paint itself over the trough's borders.

Use the border box instead, with a custom snapshot implementation.

Fixes #6332
2024-07-25 13:10:30 +03:00
Benjamin Otte
2746d3386d testsuite: Shrink maximum texture size in test
1MB textures can lead to 20s runtimes - which with asan CI being a lot
slower can be a loooong time and cause timeouts.

Limiting them to 16kB still allows hitting max texture size sometimes
but makes sure the test only runs for 3-4s worst case.
I hope that doesn't trigger timeouts even under asan.
2024-07-25 13:10:30 +03:00
Georges Basile Stavracas Neto
aaba54051f filechooserwidget: Plug a bunch of GtkBitset leaks
gtk_selection_model_get_selection() is transfer full, and the returned
bitset must be freed by the caller. GtkFileChooserWidget freed none of
them.

Unref the bitsets.

Related: https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/91
2024-07-25 13:10:30 +03:00
g.willems
6a6da0ba81 win32: Guarantee dnd-move as a cursor name
gdk currently falls back to the default cursor, which may not be
approriate for rendering a DnD move.
2024-07-25 13:10:30 +03:00
Alice Mikhaylenko
ac25e96aa1 spinner: Only set :checked state when mapped
Avoid doing the animation while it's invisible.

See https://gitlab.gnome.org/GNOME/gtk/-/issues/1025
2024-07-25 13:10:29 +03:00
Benjamin Otte
c459af78ff vulkan: Add a missing extension
We need to enable this one, too.

Thanks validation layers!
2024-07-25 13:10:29 +03:00
Dr. David Alan Gilbert
3a9bd9bd8a gdk: Remove unused struct 'XPointerUngrabInfo'
'XPointerUngrabInfo' appears unused since
commit 26cbf87d7d ("New approach for grab tracking code")
Remove it.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
2024-07-25 13:10:29 +03:00
Lukáš Tyrychtr
81e10228fe a11y: Realize the AT context before firing a children added event for it
This allows, with some other changes, AdwToasts to be read on appearance by Orca.
2024-07-24 14:59:23 +03:00
Benjamin Otte
eee0b1ecdd dmabuf: Ref previous context
In case the context's only reference was held by being the current
context, setting the new context would free it.

Resetting it later would then be a use-after-free.

Fixes #6694
2024-07-24 14:58:50 +03:00
Doğukan Korkmaztürk
7a3c6b77ef vulkan: Recreate swapchain when it is necessary or beneficial
Currently, GTK does not check the result of vkAcquireNextImageKHR() and
assumes that it always succeeds. As a result, the vkQueuePresentKHR() is
unconditionally set to wait for the semaphore passed to
vkAcquireNextImageKHR() earlier.

However, if vkAcquireNextImageKHR() fails for some reason, the semaphore
passed to it does not get signalled. This causes the presentation
command to wait for the semaphore to be signalled indefinitely, which
causes GTK to hang.

This change adds error handling around vkAcquireNextImageKHR() to make
GTK recreate the Vulkan swapchain when it is necessary or beneficial and
helps avoiding situations that could cause indefinite waits.
2024-07-24 14:58:27 +03:00
Georges Basile Stavracas Neto
85da031684 gtk-demo: Remove set-but-unused variable 2024-07-24 14:55:40 +03:00
Georges Basile Stavracas Neto
11381d8e64 win32/vulkancontext: Remove unused variable
Silences a compiler warning.
2024-07-24 14:54:54 +03:00
Georges Basile Stavracas Neto
f1d4cf9760 win32/wgl: Initialize hwnd to NULL
Otherwise there's a valid code path that may return it uninitialized.
2024-07-24 14:54:43 +03:00
Georges Basile Stavracas Neto
e9a35fe3f5 win32/cursor: Ignore GdkPixbuf deprecation warning
Seems harmless to ignore this for now, other bits of code also ignore
this.
2024-07-24 14:54:18 +03:00
Robert Ancell
ca1bb23edc glcontext: Remove duplicate check for GL version 2024-07-24 14:52:29 +03:00
Michael Weghorn
4061e9ed92 a11y atspi: Improve mapping for container roles
GTK_ACCESSIBLE_ROLE_GENERIC is for
"a nameless container that has no semantic meaning of its own",
for which AT-SPI role ATSPI_ROLE_PANEL [1]
("A generic container that is often used to group
objects.") fits better than ATSPI_ROLE_FILLER
("A object that fills up space in a user interface."),
so map to this one.

With this in place, widgets like GtkBox are again
reported with the panel role on AT-SPI level after
commit a86923de94
("a11y: Change the role for many containers"),
whose commit message suggests that the change
on the AT-SPI level was unintended.

For GTK_ACCESSIBLE_ROLE_GROUP, use the corresponding
ATSPI_ROLE_GROUPING ("A group of related widgets.
This group typically has a label.").

[1] https://docs.gtk.org/atspi2/enum.Role.html
2024-07-24 14:50:25 +03:00
Chao-Hsiung Liao
7b4780e2aa Update Chinese (Taiwan) translation 2024-07-16 13:01:10 +00:00
Pawan Chitrakar
d4a57811c7 Update Nepali translation 2024-07-14 07:40:45 +00:00
Pawan Chitrakar
4c97bde1ef Update Nepali translation 2024-07-11 09:52:13 +00:00
Chao-Hsiung Liao
25ac3c42e6 Update Chinese (Taiwan) translation 2024-07-08 22:56:49 +00:00
Danial Behzadi
74f368bc02 Update Persian translation 2024-06-28 22:10:17 +00:00
Matthias Clasen
0b3520049d Merge branch 'null-tile-cherry-pick-4-14' into 'gtk-4-14'
Cherry-pick Empty Listbase Crash Fix to 4.14

See merge request GNOME/gtk!7381
2024-06-27 01:22:33 +00:00
Matthias Clasen
e59c462f27 Merge branch '4-14-no-c-format' into 'gtk-4-14'
gtkfilechooserwidget: Mark string as no-c-format

See merge request GNOME/gtk!7377
2024-06-27 00:11:31 +00:00
Benjamin Otte
de52518018 columnview: Actually check the listview in return_if_fail()
This was missed when adding return_if_fail()s in
172cdf8e21.

Related: !7240
2024-06-25 23:50:33 +03:00
Khalid Abu Shawarib
bf47031699 listbase: Return early on non-existent scroll position 2024-06-25 23:50:30 +03:00
Anders Jonsson
a258f2b993 gtkfilechooserwidget: Mark string as no-c-format
gettext 0.22 recognizes %b as a C string format which
not is true for date strings, so explicitly mark as
no-c-format.

(cherry picked from commit 5df9b1cb5b)
2024-06-23 06:43:44 +02:00
Милош Поповић
0d007345b8 Update Serbian translation 2024-06-20 17:40:22 +00:00
Fran Dieguez
29bbd1f329 Update Galician translation 2024-06-11 21:00:59 +00:00
Rachida SACI
1892761b46 Update Kabyle translation 2024-06-07 02:24:11 +00:00
Matthias Clasen
b237d76b1a Merge branch 'michaelweghorn/gtk-4-14_a11y_label_name' into 'gtk-4-14'
a11y: Use text instead of label for GtkLabel's a11y name [GTK 4.14 backport]

See merge request GNOME/gtk!7317
2024-05-31 20:00:04 +00:00
Michael Weghorn
3143ab887e a11y: Use text instead of label for GtkLabel's a11y name
Update the `GTK_ACCESSIBLE_PROPERTY_LABEL` property
in `gtk_label_set_text_internal` using the new text
instead of using the label in
`gtk_label_set_label_internal`.

While the `label` "includes any embedded underlines
indicating mnemonics and Pango markup" [1], the
`text` is the "text is as it appears on screen" [2],
which is more suitable for the accessible name.

With this in place, the text is reported as the
accessible name again after

    commit d5b34aecdd
    Date:   Wed Jan 17 12:49:38 2024 +0100

        a11y: Remove special handling of accessible names for static text widgets

[1] https://docs.gtk.org/gtk4/method.Label.get_label.html
[2] https://docs.gtk.org/gtk4/method.Label.get_text.html

Fixes: #6732
Fixes: #6735
(cherry picked from commit 317e68a58c)
2024-05-30 07:55:44 +02:00
Matthias Clasen
1dbea91db4 Merge branch 'wip/xdg-dialog-4-14' into 'gtk-4-14'
gdk/wayland: Implement support for xdg-dialog Wayland protocol [4.14]

See merge request GNOME/gtk!7256
2024-05-29 23:16:34 +00:00
Matthias Clasen
355a9f4d13 Merge branch 'gtk-4-14-backports' into 'gtk-4-14'
[4.14] macOS backports

See merge request GNOME/gtk!7292
2024-05-29 23:14:49 +00:00
Matthias Clasen
0512da0ad4 Merge branch 'windows-fixes-backport' into 'gtk-4-14'
Backport: 32-bit Windows build and runtime fixes for NGL and Vulkan

See merge request GNOME/gtk!7307
2024-05-29 20:39:14 +00:00
Chun-wei Fan
9c478afbd7 gskvulkandevice.c: Put Vk[Pipeline|RenderPass] in structures
This way, we can simply duplicate the keys as separate pointers to store
the corresponding Vulkan handles so that we can safely hash them, as
Vulkan handles may or may not be pointers depending on the target
platform.

This will fix builds on 32-bit Windows at least.
2024-05-29 18:44:18 +08:00
Chun-wei Fan
757e35cf67 gdkvulkancontext.c: Use pointers to hash VkShaderModule
VkShaderModule's may or may not be pointers depending on the target
platform, so use pointers to hash those handles to be safe, and retrieve
them from hashes accordingly.

Fixes build on 32-bit Windows at least.
2024-05-29 18:44:06 +08:00
Chun-wei Fan
1029238d59 gskvulkanmemory.c: Use VK_NULL_HANDLE for VkDeviceMemory
...rather than NULL, so that things will build fine on non-LLP, non-64-bit
systems.
2024-05-29 18:43:55 +08:00
Chun-wei Fan
2312949713 gsk: Call glDeleteSync() directly
This function does not use the standard __cdecl calling convention on
Windows, meaning using g_clear_pointer() on it directly will cause
crashes on 32-bit Windows.  Just call it directly if the GLsync it uses
exists.
2024-05-29 18:43:38 +08:00
Benjamin Otte
79bf324468 Merge branch 'cherry-pick-3c149142' into 'gtk-4-14'
gsk: use the correct memory type index

See merge request GNOME/gtk!7291
2024-05-23 18:24:03 +00:00
Michael Catanzaro
d0641a656c text: fix critical in paste_received
Here we calculate the length only in the truncate_multiline condition.
Then we pass pos - 1 to gtk_accessible_text_update_contents() as the end
position, triggering this critical that checks to ensure start <= end.
Fix it by always calculating the length of the string that we insert.

This is the first bug fixed as a result of enabling fatal criticals by
default in Epiphany! 🎉

Fixes #6734


(cherry picked from commit eb4993d3fb)
2024-05-23 16:09:42 +00:00
Carlos Garnacho
726a6a883a gdk/wayland: Implement support for xdg-dialog Wayland protocol
This protocol lifts some functionality from the gtk-shell protocol,
namely the ability to tag dialogs as modal. Ensure to use this
new protocol if available for the task, instead of the gtk-shell
protocol.
2024-05-23 12:16:14 +02:00
Carlos Garnacho
a9513b6200 build: Handle in-tree copies of wayland protocols
Convert the array managing the Wayland protocols to contain
dictionary objects for each of the protocol definitions, in order
to make it easier to extend for extra keys in them.

And also add one such extra 'required' key, so that we can
optionally build protocols depending on the wayland-protocol
version detected at runtime. This is necessary to add fallbacks
for upstream protocols without necessarily bumping GTK dependency,
some versioning handling of private protocols was added too
for this purpose, so we can have in-tree copies of them.
2024-05-23 12:16:09 +02:00
Mat
605d1e4043 gdkmacossurface: Set surface before accessing it
Silences the following critial:
_gdk_macos_surface_update_fullscreen_state: assertion
'GDK_IS_MACOS_SURFACE (self)' failed
2024-05-23 01:40:48 +03:00
Mat
e29d84abdb macos: Take shadows into account when positioning popups
Otherwise popups will be misaligned. This becomes noticeable when larger
shadows are used, like in libadwaita.

Regression in 08216dcee9
2024-05-23 01:40:03 +03:00
Thomas Holder
32c765088d macOS: Dock "Quit" invokes "app.quit" action
Allows the application to handle "Dock icon > Quit" the same as
"Application menu > Quit".

Requires GtkApplication's `register-session` property.

Suitable replacement for gtk-mac-integration's
`NSApplicationBlockTermination` signal.
2024-05-23 01:39:30 +03:00
Benjamin Otte
3ae9c7381b Merge branch 'wip/otte/for-main' into 'main'
gsk: use the correct memory type index

See merge request GNOME/gtk!7287

(cherry picked from commit 3c1491423a)

130a6fe0 gsk: use the correct memory type index
2024-05-22 22:07:30 +00:00
Matthias Clasen
db444e6d4a Merge branch 'inspector-hint-style-crash' into 'gtk-4-14'
[GTK 4.14] inspector: Prevent crash when hint style isn't set

See merge request GNOME/gtk!7277
2024-05-21 11:06:37 +00:00
Mat
f426ac6f54 inspector: Prevent crash when hint style isn't set
The hint style can be null, e.g. on macOS.
2024-05-20 23:31:39 +03:00
Matthias Clasen
a2fc5eb3f8 inspector: Avoid writing settings back needlessly
We were a bit careless and were writing some values back to the
GtkSettings on init, possibly with rounding errors. Avoid that.
2024-05-20 22:48:27 +03:00
Balázs Úr
b76c2967e3 Update Hungarian translation 2024-05-19 23:42:17 +00:00