When an unrealized GtkATContext (that doesn't come from a GtkWidget) is
attached to a realized parent, nothing happens. That's because, while
GtkWidget is able to realize itself at the appropriate times, that may
not be true for non-widget accessibles.
Realize the child AT context if the parent is realized, when manually
attaching the AT context to a parent.
This allows reporting the proper geometry for the AT. This is a simple
implementation that simply uses the extents of the first GtkWidget that
is parent of the GtkAtSpiSocket accessible.
GTK does not support completely detached accessible trees, so a parent
GtkWidget is guaranteed to exist. Assert that in code.
This is a GtkAccessible object that represents a connection to a remote
plug object. It is particular to the AT-SPI backend, which is why it's
made to fail when gtk_at_context_create() creates anything that is not
a GtkAtSpiContext.
The resulting accessible object created by GtkAtSpiSocket only ever has
1 child, which is the remote accessible plug object. This remote object
cannot be represented by an actual GtkAccessible instance without
copying over its contents, which is unfeasible; therefore, add special
cases in exactly 3 places in GtkAtSpiContext to handle this.
This object is made so that WebKitGTK, which renders web pages and keeps
the a11y tree of the DOM page in a separate process, can be bridged to
the GTK4 UI process.
Show the fractional scale if we have one, and pixels.
Only Wayland has fractional scales, and for monitors, we have
to derive it from the logical and physical resolution of the
monitor. Not ideal, but it works.
The first time this function is called, has_xdg_output() returns
true, but haven't yet received all the xdg-output events, so wait
for that to be done. Otherwise, the logical size is 0, and nothing
useful comes from that.
This fixes a problem that is apparent in
https://bugzilla.mozilla.org/show_bug.cgi?id=1869724, but that also
reproduces on any GTK application as described in
https://bugzilla.mozilla.org/show_bug.cgi?id=1869724#c16.
xdg_output sizes might be physical if the compositor doesn't scale them,
it seems. So to report the correct logical geometry in GDK pixels, we
need to detect this case. We do this by checking whether the wl_output
size matches the xdg_output size.
According to the Mesa developers, the correct way to determine
disjointness is to check the actual inode of the fd because dup()ing can
cause these duplications to happen when planes are carelessly copied or
when planes are sent over dbus or other unix sockets.
Related: https://bugs.webkit.org/show_bug.cgi?id=267578
With GTK_ACCESSIBILITY_ATSPI as its sole define for now. This will
allow clients to conditionally include gtk/a11y/gtkatspi.h if they
need to use the AT-SPI specific functions.
We can reach the code that removes the item from the hash table
before or after the weak unref has triggered. Just leave the
weakref in place and let it do its thing, if it hasn't gone
off yet. That matches what we do in free.
Fixes: #6377
We do gc in a timeout, when an arbitrary GL context might be
current, so we need to make sure its ours and we don't free
random textures in another context.
Fixes: #6366
Window handles allow windows to be dragged from maximized to restored,
but when the window is fullscreen they do nothing. With this change,
windows will be unfullscreened when dragged.
By implementing support for `GdkDmabufTextureBuilder` and
`GstVideoInfoDmaDrm`. This allows zero-copy video playback on Wayland
when paired with hardware video decoding.
Can be tested with `gtk4-demo --run=video_player`
We keep various pieces of double-buffered state on our side,
and then explicitly sync it over to the Wayland side.
Add a function to find out if we have any.