Commit Graph

82004 Commits

Author SHA1 Message Date
Matthias Clasen
5b6b42b5a9 x11: Fix initialization mess
When prepare_gl fails in the right way (or the wrong way?), we
end up creating the leader window twice, and as a side effect,
creating two instances of the "Virtual core pointer" device, which
is bad news for grabs.

Fixes: #6840
2024-08-31 11:28:52 -04:00
Matthias Clasen
ae8a06cdca x11: Cosmetics
Don't return FALSE from a function returning a pointer.
2024-08-31 11:28:52 -04:00
Carlos Garnacho
cba4ce03e5 gtkwidget: Check for destroyed controllers while propagating state
Keep a hard copy of the widget event controllers to handle state
changes across, and check for controllers that might have been detached.
This makes us:

- Tiptoe over controllers that might have been removed directly or
  indirectly as a result of a signal emitted here, which is great and
  fixes possible crashes.
- Ignore new controllers that might have been added in the handling
  of these signals, which is fair enough since these controllers did
  not handle any input related to the state change.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/6924
2024-08-31 16:37:58 +02:00
Carlos Garnacho
5e82ad3ea7 gtkeventcontroller: Reset controller when detaching from a widget
We want internal state ensured to be forgotten, and the controller
to be ready for use for any future time it might be added to a
widget again.
2024-08-31 16:37:35 +02:00
Piotr Drąg
c9bbf5820b Update Polish translation 2024-08-31 15:00:38 +02:00
Simon McVittie
bb0b764172 Merge branch 'wip/smcv/bug6971' into 'main'
testsuite: Add a suite for tests that require /dev/udmabuf

See merge request GNOME/gtk!7671
2024-08-31 11:53:32 +00:00
Matthias Clasen
ae8e9ef650 Merge branch 'vulkan-dnd-offset' into 'main'
vulkan: Use wl_surface_offset

Closes #6972

See merge request GNOME/gtk!7673
2024-08-31 11:47:53 +00:00
Matthias Clasen
8df7ff75bb Merge branch 'radio_role_for_check_button_groups' into 'main'
a11y: Set the correct role for check button groups

See merge request GNOME/gtk!6551
2024-08-31 11:20:16 +00:00
Matthias Clasen
bbfd8e0e89 vulkan: Use wl_surface_offset
Call wl_surface_offset in end_frame to apply the offset for drag
surfaces. This matches what the GL draw context already does, and
it fixes drag surfaces jumping at the beginning of the drag.

Fixes: #6972
2024-08-31 07:15:08 -04:00
Matthias Clasen
467212877f Merge branch 'wip/smcv/css-endian' into 'main'
CSS: Fix test failures on 64-bit big-endian machines

See merge request GNOME/gtk!7672
2024-08-31 11:04:45 +00:00
Simon McVittie
204b8857a1 testsuite: Add a suite for tests that require /dev/udmabuf
On GTK's official upstream CI, all Linux runners are meant to have
/dev/udmabuf available, so this should pass. On developer machines or
downstream build environments, this can't be guaranteed (not all kernel
configurations offer that device, and on those that do, an autobuilder
might not have access to it) so make it possible to skip this with
`--no-suite=needs-udmabuf`.

Any future tests that rely on /dev/udmabuf (as opposed to using it for
optional better coverage if available, like replay-node does) can be
aded to the same suite.

Signed-off-by: Simon McVittie <smcv@debian.org>
2024-08-31 10:22:49 +01:00
Simon McVittie
a524524ffd gtkcssprovider: Fix sorting of custom property IDs on 64-bit big-endian
This function is used to sort a GPtrArray of "pointers" which are
actually GINT_TO_POINTER (id), so a and b are pointers to pointer-sized
quantities.

Previously it was assuming that both were int-sized quantities,
dereferencing them to get the first sizeof(int) bytes, and then
redundantly casting those bytes to int. However, on a 64-bit big-endian
platform, the first few bytes of a larger-than-int quantity are the
most significant part, in practice 0, causing an out-of-bounds array
access and a crash. This was visible in the
`gtk:css / parser variables.css` automated test.

Bug-Debian: https://bugs.debian.org/1079546
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-08-31 02:26:57 +01:00
Simon McVittie
3ef1f448a3 gtkcssvariableset: Fix listing IDs on big-endian machines
Previously this code assumed that if we have an int stored in a hash
table via GINT_TO_POINTER, we can retrieve the pointer value and treat
its first sizeof(int) bytes as an item to append to a GArray of int.

However, on a 64-bit big-endian system, the first sizeof(int)
bytes of the pointer will be zero, which is not a valid ID for a
GtkCssCustomPropertyPool, causing an out-of-bounds array access and
a crash. This was visible in the `gtk:css / style` automated test.

Bug-Debian: https://bugs.debian.org/1079546
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-08-31 02:04:00 +01:00
Matthias Clasen
a5df8f2f35 Merge branch 'dead-hamza-yay' into 'main'
Update a script slightly

Closes #6968

See merge request GNOME/gtk!7670
2024-08-31 00:14:25 +00:00
Emmanuele Bassi
b56a8c7f88 Merge branch 'wip/fina/accessible-atspi-fix-error-message' into 'main'
a11y: Consistently use list type for errormessage relation

See merge request GNOME/gtk!7528
2024-08-31 00:08:52 +00:00
Fina Wilke
649782b547 a11y: Consistently use list type for errormessage relation
This more closely matches the spec. This is an API break, however the
atspi backend already assumed that this was a list, and would throw
criticals whenever this relation was set. Therefore it can be assumed
that this relation was not previously in active use.
2024-08-30 20:22:59 +00:00
Matthias Clasen
97245e9baa Merge branch 'ebassi/lazier-a11y' into 'main'
a11y: Watch EventListenerRegistered/Deregistered signals

See merge request GNOME/gtk!7298
2024-08-30 20:17:17 +00:00
Matthias Clasen
0f3c27c8a5 composetable: Handle dead_hamza
A new dead key has been invented.

Fixes: #6968
2024-08-30 16:10:20 -04:00
Matthias Clasen
3273637179 Update keyname tables 2024-08-30 16:03:40 -04:00
Matthias Clasen
1eaa0e9b74 gdkkeysyms.h: Regenerate for libX11 1.8.10 2024-08-30 15:52:58 -04:00
Matthias Clasen
28d1bce2d4 Update a script slightly
Make gdkkeysyms-update.pl use #pragma once, as our headers
do nowadays.
2024-08-30 15:52:14 -04:00
Emmanuele Bassi
b8072d8562 a11y: Add a check for sandboxed accessibility bus
When sandboxed, the accessibility bus needs a recent version of Flatpak
and its D-Bus proxy in order to relay event registrations.
2024-08-30 14:24:55 +01:00
Luca Bacci
da9886d822 Merge branch 'fix-gdk-win32-display-name' into 'main'
GDK/Win32: Fix gdk_display_get_name()

See merge request GNOME/gtk!7664
2024-08-30 12:32:16 +00:00
Matthias Clasen
747f2e5af6 Merge branch 'demos-window-icons' into 'main'
demos: Set icon for the windows

See merge request GNOME/gtk!7661
2024-08-30 11:14:18 +00:00
Matthias Clasen
aeb3ee0969 Merge branch 'update-on-print-comboentry-change' into 'main'
printeroptionwidget: Update on combo-entry change

Closes #6782

See merge request GNOME/gtk!7532
2024-08-30 11:11:55 +00:00
Benjamin Otte
e248f1a4b5 Merge branch 'wip/otte/compare-render' into 'main'
Bring compare-render into 21st century

See merge request GNOME/gtk!7648
2024-08-30 11:00:36 +00:00
Arjan Molenaar
d23833285e macos: Set transparent background for toplevel window
Toplevel window background is almost transparent.
For fully transparent windows the (macOS) shadow calculatation
becomes really slow.
2024-08-30 12:06:18 +02:00
Daniel Rusek
ff9fe6857f Update Czech translation 2024-08-30 09:49:04 +00:00
Emmanuele Bassi
58f2d3fbe7 a11y: Add reference counting to event listeners
Event listeners can register themselves multiple times, and deregister
themselves as well. We need to remove an event listener only if it
dropped all its events.
2024-08-30 09:27:39 +01:00
Emmanuele Bassi
d9f75581be a11y: Get event listeners on root registration
We ask the AT-SPI registry for event listeners already registered when
connecting the root object, in case an AT is running.
2024-08-30 09:27:39 +01:00
Emmanuele Bassi
307efe2172 a11y: Do not emit event signals if there are no listeners
Now that we track event listeners, we can skip the accessibility event
emission altogether if we know nothing is on the other side.
2024-08-30 09:27:39 +01:00
Emmanuele Bassi
4ea4dc9176 a11y: Watch EventListenerRegistered/Deregistered signals
Assistive technologies using AT-SPI typically register themselves on the
accessibility bus through the org.a11y.atspi.Registry.RegisterEvent
method, which will emit the EventListenerRegistered signal. We can use
that signal (and its corresponding EventListenerDeregistered sibling) to
know whether there is at least an AT on the other side of the
accessibility bus.
2024-08-30 09:27:39 +01:00
Benjamin Otte
fa25015e8c compare-render: Appease clang and MSVC
clang wants consts not initialized from consts.

MSVC can't deal with arrays in initializers.
2024-08-30 06:28:58 +02:00
Benjamin Otte
296b6b1ed5 compare-render: Make the test runner generic
Instead of manually running each of the tests, use a loop and just
invoke the test runner.
2024-08-30 06:28:58 +02:00
Benjamin Otte
b88fe301be compare-render: Run clip tests using new runner
This requires adding infrastructure to generate per-test data, so that
the random clip rect can be computed and reused for both test and
reference generation.

So add this infrastructure.
2024-08-30 06:28:58 +02:00
Benjamin Otte
ffd836e6f4 compare-render: Run replay tests using new runner 2024-08-30 06:28:58 +02:00
Benjamin Otte
457cf66d0d compare-render: Run mask tests using new runner 2024-08-30 06:28:58 +02:00
Benjamin Otte
36765745a1 compare-render: Run rotate tests using new runner 2024-08-30 06:28:58 +02:00
Benjamin Otte
46c19a3d28 compare-render: Run repeat tests using new runner 2024-08-30 06:28:58 +02:00
Benjamin Otte
6cf928eb6c compare-render: Run flip tests using new runner 2024-08-30 06:28:58 +02:00
Benjamin Otte
a0d076f01a compare-render: Run plain tests using new runner
Extend the runner so NULL is accepted as a method to create
reference/test, in which case the unmodified original will be used.
2024-08-30 06:28:58 +02:00
Benjamin Otte
37c744759c compare-render: Add a generic test runner
... and port the colorflip test.

This is so we can factor out generic parts of the code. This allows
making changes easier to those parts, like if we want to introduce
rules for what colorstates and memory depths to do diffs in.
2024-08-30 06:28:58 +02:00
Benjamin Otte
277a05eb8c compare-render: Use consistent naming for files
Instead of the adverb, use the verb term. That matches the argument
passed on the cmdline, so only one string is necessary.
2024-08-30 06:28:58 +02:00
Chun-wei Fan
0376e4668c GDK/Win32: Fix gdk_display_get_name()
We switched to using the Unicode (UTF-16) versions of the Windows API by
default, so we also obtain the display name in UTF-16 form as well.

This updates the implementation in the Windows backend so that we
properly acquire the names that we need in UTF-16, and then convert the
results to UTF-8, which is what we use in GTK/GLib.
2024-08-30 08:47:01 +08:00
Changwoo Ryu
9d5652de64 Update Korean translation 2024-08-29 23:29:49 +00:00
Matthias Clasen
bb109b5d9e Merge branch 'matthiasc/for-main' into 'main'
docs: Mention that Broadway is an experiment

See merge request GNOME/gtk!7665
2024-08-29 22:52:39 +00:00
Benjamin Otte
d630ddd182 compare-render: Pick colorstate from reference when comparing
When comparing textures, always pick the colorstate from the reference
texture. This allows us to define what color state we expect.

For now, there's no check that the color states are equal, because they
don't really have to be as long as the pixels are.
2024-08-29 20:34:23 +02:00
Benjamin Otte
e268041a42 reftest-compare: Respect color states when diffing
Always pick the color state from texture1 and download the data and
generate the diff in that color state.

That now means the order of the 2 arguments matters.
2024-08-29 20:34:23 +02:00
Benjamin Otte
f9cbeeeedc reftest-compare: Compare high depth images in high depth
I first tried porting everything to float, but it turns out that that
makes a compare-render run (with all 1520 tests succeeding) 9s slower
so I decided to keep the existing U8 code.

A side benefit is that saving the diff to PNG will continue creating
U8 PNGs.
2024-08-29 20:34:23 +02:00
Benjamin Otte
62542f836f compare-render: Create rotated reference without gdk-pixbuf
We use the renderer to create the reference for the rotate test by
applying the same rotate transform to the reference image instead of the
tested node.

This is somewhat suboptimal because they run very similar codepaths, but
this method works with high bit depth content and different colorstates

This concludes the port away from gdk-pixbuf and means that all rendered
content and reference images can now use high bit depth and colorstates.
2024-08-29 20:34:23 +02:00