Commit Graph

79096 Commits

Author SHA1 Message Date
Matthias Clasen
77c115c224 node-editor: Make crash handling more robust
Handle cases where the crash only happens in render(), and not
in reload().
2024-02-06 18:41:47 +00:00
Matthias Clasen
c76fd1548e Merge branch 'dont-typo-fix' into 'main'
tools: Add missing contraction in string

See merge request GNOME/gtk!6843
2024-02-06 16:52:05 +00:00
Matthias Clasen
da142e02be Merge branch 'gbsneto/atspi-socket' into 'main'
AT-SPI socket

See merge request GNOME/gtk!6827
2024-02-06 16:47:41 +00:00
Matthias Clasen
8602745858 Merge branch 'wip/alice/typo' into 'main'
display-wayland: Fix a typo

See merge request GNOME/gtk!6844
2024-02-06 16:42:40 +00:00
Georges Basile Stavracas Neto
3e3eda416c build: Generate gtk-atspi.pc with better description
Not much to see, but this coded in such a way that potential new a11y
APIs are exposed with a nice description in their pkg-config file as
well.
2024-02-05 15:17:42 -03:00
Georges Basile Stavracas Neto
140ad373f7 atcontext: Realize child if parent is realized
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.
2024-02-05 15:10:39 -03:00
Georges Basile Stavracas Neto
7e9c18c16e a11y: Expose the Component object for GtkAtSpiSocket
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.
2024-02-05 15:10:36 -03:00
Georges Basile Stavracas Neto
88b3e8552a a11y: Introduce GtkAtSpiSocket
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.
2024-02-05 15:10:15 -03:00
Alice Mikhaylenko
a6f9bab8f3 display-wayland: Fix a typo 2024-02-05 19:42:55 +04:00
Anders Jonsson
12e15c0ee0 tools: Add missing contraction in string 2024-02-05 00:23:29 +01:00
Benjamin Otte
9216779963 Merge branch 'wip/otte/for-main' into 'main'
rendernode: Implement diff() for repeat nodes

Closes #6389

See merge request GNOME/gtk!6842
2024-02-04 21:15:49 +00:00
Benjamin Otte
2e669099a6 testsuite: Add a test for previous commit
Related: #6389
2024-02-04 21:57:13 +01:00
Benjamin Otte
2a3a5753c1 gpu: Don't optimize too much
The rect clip can only be ignored if the scissor rect is contained in
the clip. But sometimes it isn't.

Fixes #6389
2024-02-04 21:57:13 +01:00
Benjamin Otte
88bed27f85 blurop: Print the blur radius 2024-02-04 21:57:13 +01:00
Benjamin Otte
b49b055183 rendernode: Implement diff() for repeat nodes
If the children have an empty diff and the repeat nodes' sizes are
equal, the diff is empty.
2024-02-04 21:57:13 +01:00
Piotr Drąg
988c7d1626 Update POTFILES.in 2024-02-04 13:12:12 +01:00
Matthias Clasen
f9acf3bb20 Merge branch 'wip/chergert/disable-dmabuf-on-macos' into 'main'
tests: require linux for dmabuf test

See merge request GNOME/gtk!6839
2024-02-02 23:46:08 +00:00
Christian Hergert
1b0f2cfeb8 tests: require linux for dmabuf test 2024-02-02 12:59:13 -08:00
Georges Basile Stavracas Neto
e8b249281d build: Generate gtk-atspi.pc 2024-02-01 11:17:02 -03:00
Luca Bacci
5483821ea0 Merge branch 'gdk-win32-empty-frame' into 'main'
GdkWin32: Implement GdkDrawContext::empty_frame() vfunc

See merge request GNOME/gtk!6831
2024-01-31 12:39:11 +00:00
Matthias Clasen
05e25557e1 Merge branch 'gtk4-monitor-size' into 'main'
[gtk4/wayland] Fix GdkMonitor sizes on Mutter without fractional scaling.

See merge request GNOME/gtk!6832
2024-01-31 10:14:41 +00:00
Matthias Clasen
f80989332f inspector: Better monitor information
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.
2024-01-30 20:56:16 -05:00
Matthias Clasen
8df8d0bd5d monitor: Add gdk_monitor_get_scale
This matches the surface api we have, and closes an api gap.
2024-01-30 20:56:08 -05:00
Matthias Clasen
ea6ad66ee3 wayland: Small fixup to monitor size handling
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.
2024-01-30 20:54:31 -05:00
Emilio Cobos Álvarez
5ceb9a7692 [gtk4/wayland] Fix GdkMonitor sizes on Mutter without fractional scaling.
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.
2024-01-30 20:10:36 -05:00
Benjamin Otte
216dbf1e88 Merge branch 'wip/otte/dmabuf-disjoint' into 'main'
dmabuf: Fix disjoint detection

See merge request GNOME/gtk!6830
2024-01-30 18:17:33 +00:00
Matthias Clasen
ff4db4ed71 Merge branch 'macos-file-filter-pixbufs' into 'main'
macos: Add pixbuf formats similar to mime-types

Closes #5296

See merge request GNOME/gtk!6754
2024-01-30 16:56:52 +00:00
Luca Bacci
57dde7e877 GdkWin32: Implement GdkDrawContext::empty_frame() vfunc 2024-01-30 16:23:28 +01:00
Benjamin Otte
9581d060d2 dmabuf: Fix disjoint detection
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
2024-01-30 15:19:34 +01:00
Georges Basile Stavracas Neto
63e44a34ae gtk/a11y: Install empty gtk/a11y/gtkatspi.h header
The header doesn't include anything other than gtk.h itself, but
next commits will populate this with some extra includes.
2024-01-30 10:03:40 -03:00
Georges Basile Stavracas Neto
afbd7cfe55 build: Install gtkconfig.h header
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.
2024-01-30 10:03:40 -03:00
Matthias Clasen
ead1b36afd Merge branch 'macos-empty-frame' into 'main'
[macos] Add callbacks for Gdk.DrawContext.empty_frame

See merge request GNOME/gtk!6819
2024-01-30 01:06:14 +00:00
Benjamin Otte
1ffa01b38a Merge branch 'contentview-step1-finished' into 'main'
[macos] Use system shadow on macOS

Closes #6255

See merge request GNOME/gtk!6785
2024-01-29 18:09:33 +00:00
Matthias Clasen
f93601ed2b Merge branch 'cache-weak-unref' into 'main'
gpu: Fix a problem with texture caches

Closes #6377

See merge request GNOME/gtk!6824
2024-01-29 13:24:56 +00:00
Matthias Clasen
e1722777e5 Merge branch 'drag-out-of-fullscreen' into 'main'
gtk: Make window handles work when attached to fullscreen windows

See merge request GNOME/gtk!6825
2024-01-29 13:15:46 +00:00
Matthias Clasen
24850dff0e Merge branch 'fix-gc-context' into 'main'
gpu: Call make current before gc

Closes #6366

See merge request GNOME/gtk!6826
2024-01-29 13:13:43 +00:00
Matthias Clasen
d790268031 gsk: Move gc calls
maybe_gc() may make a different context current, so do it before
the renderer has made its own context current.
2024-01-29 08:12:27 -05:00
Matthias Clasen
89712fc750 gpu: Fix syntax confusion. 2024-01-29 08:12:27 -05:00
Matthias Clasen
9b62a5c931 gpu: Drop an unused argument
The timestamp wasn't used in atlas creation.
2024-01-29 08:12:27 -05:00
Matthias Clasen
fbf3836502 gpu: Drop excessive logging
This was logging every frame, which is too much.
2024-01-29 08:12:27 -05:00
Matthias Clasen
8d80f97597 gpu: free non-atlased glyphs
"Only free glyphs when their atlas is freed" works great for
glyphs that are on an atlas. Don't forget the others.
2024-01-29 08:12:27 -05:00
Matthias Clasen
e6ec8133a5 gpu: Don't weak unref too much
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
2024-01-29 08:11:25 -05:00
Matthias Clasen
6b436fdbbb gsk: Move gc calls
maybe_gc() may make a different context current, so do it before
the renderer has made its own context current.
2024-01-29 07:49:59 -05:00
Matthias Clasen
7b2b5469eb gpu: Call make current before gc
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
2024-01-29 07:39:57 -05:00
Benjamin Otte
3fc325d799 Merge branch 'dmabuf-texture-gst-v4l2' into 'main'
gstsink: Add support for DMABuf import and graphics offload

See merge request GNOME/gtk!6618
2024-01-29 11:06:11 +00:00
Ben Mather
dee6742931 gtk: Allow windows to be dragged out of fullscreen using a window handle
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.
2024-01-29 09:51:16 +00:00
Robert Mader
d2097d0449 gstsink: Add support for DMABuf import and graphics offload
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`
2024-01-28 19:09:41 +01:00
Matthias Clasen
c7f00d51eb Merge branch 'wayland-empty-frame' into 'main'
wayland: Add a way to check if a surface is dirty

See merge request GNOME/gtk!6822
2024-01-28 17:02:29 +00:00
Matthias Clasen
f5308dfbec wayland: Commit empty frames if needed
If we have outstanding double-buffered state (other than the
buffer itself), commit a frame even if its 'empty'.
2024-01-28 11:44:16 -05:00
Matthias Clasen
1097e1349c wayland: Add a way to check if a surface is dirty
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.
2024-01-28 11:44:16 -05:00