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
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.
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.
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
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.
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#7022Fixes#7025
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
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/31292Fixes: !7020