Commit Graph

78932 Commits

Author SHA1 Message Date
Benjamin Otte
70f0cde730 tests: Fix gio API usage
Related: glib!3261
2024-01-16 06:22:43 +01:00
Christian Hergert
14e78663ee expression: combine GWeakNotify and GWeakRef for bind expression
This does the same thing to GtkExpressionBind that was done to
GtkExpressionObject. Use a GWeakRef to ensure we're working with a valid
object instead of relying on when our weak pointer and/or notify callback.
2024-01-15 20:59:27 -08:00
Christian Hergert
d8279209a2 expression: retrieve next pointer before notifying closure
Any time we call back into user code we risk re-entrancy issues. Get the
next pointer for the list before calling back into notifiers.
2024-01-15 20:41:45 -08:00
Christian Hergert
a0527ff0bd expression: combine GWeakNotify and GWeakRef for object expression
When using a GtkObjectExpression multiple times in the same GtkBuilder
template, we can run into a situation where we are in disposal but have
not yet had our callback notified.

This attempts to improve on that situation by using something I've done in
other projects for years. Combine both GWeakNotify and GWeakRef. Only use
the GWeakRef to get an object instance rather than relying on the
GWeakNotify alone.

By doing this, we can avoid trying to remove an object weak reference for
an object that is in disposal and causing runtime warnings.

Fixes #5542
Fixes #6220
2024-01-15 19:29:29 -08:00
Matthias Clasen
771ea81715 Merge branch 'fix-doc-link' into 'main'
docs: Update link to GitLab documentation

See merge request GNOME/gtk!6764
2024-01-16 01:49:34 +00:00
Emmanuele Bassi
f22a3f9ec6 Revert "Merge branch 'demos-enable-vulkan' into 'main'"
This reverts merge request !6724
2024-01-16 00:45:00 +00:00
Matthias Clasen
246876a404 Add a test for font-related node parser errors
This tests the behaviors implemented in the previous commit.
2024-01-15 18:58:17 -05:00
Matthias Clasen
27a086b5f0 Add a test for new text node syntax
Add a test that checks that font: properties can be parsed without
error, both with and without the optional url.
2024-01-15 18:58:17 -05:00
Matthias Clasen
8158945de9 gsk: Allow custom fonts in node files
This will let us store complete test fonts inside node files,
as data: urls. You can also use a file: url to refer to a local
file.

The syntax is as follows:

text {
  font: "FONT DESCRIPTION" url("data:font/ttf;base64,FONT DATA");
}

with the url being optional.
2024-01-15 18:58:17 -05:00
Matthias Clasen
1c85141612 gsk: Keep a fontmap reference in text nodes
A PangoFont keeps a weak reference to its fontmap. In addition,
keep a strong reference in GskTextNode, so we can be sure that
custom font maps won't go away before the node is finalized.
2024-01-15 18:25:15 -05:00
Matthias Clasen
690381672b tests: Fix up test font naming
The entry for the family name in the name table has nameID=1, not
nameID=0, so we were relying on the filename to be just right.
Oops.
2024-01-15 18:25:15 -05:00
Matthias Clasen
3d7ff44dc5 Cosmetics 2024-01-15 18:25:15 -05:00
Florian Müllner
a518c59098 docs: Update link to GitLab documentation
The original link no longer works, so update the reference to
point to the currently correct location.
2024-01-15 21:41:15 +01:00
Benjamin Otte
1dd5e92499 Merge branch 'unroot' into 'main'
gtkcolumnviewcellwidget: move cleanup from dispose to unroot

Closes #6200

See merge request GNOME/gtk!6758
2024-01-15 14:13:09 +00:00
Matthias Clasen
fbd3c5ebd0 Merge branch 'matthiasc/for-main' into 'main'
Update the node format docs

See merge request GNOME/gtk!6761
2024-01-15 13:00:51 +00:00
Matthias Clasen
48dc7df5b7 Update the node format docs
Mention the new syntax for naming and reusing textures.
2024-01-15 07:46:18 -05:00
Emmanuele Bassi
0c4c90d606 Merge branch 'stackpage-auto-cleanup' into 'main'
stack: Add automatic cleanup for GtkStackPage

See merge request GNOME/gtk!6760
2024-01-15 11:33:07 +00:00
Guido Günther
da954d20f9 stack: Add automatic cleanup for GtkStackPage
Useful when iterating over the pages via g_list_model_get_item ().
2024-01-15 11:48:21 +01:00
tszymanski
ff262c081e gtkcolumnviewcellwidget: move cleanup from dispose to unroot
No longer gets stuck in an infinite loop.

Fixes #6200
2024-01-14 15:38:21 -08:00
Matthias Clasen
c6967234de Merge branch 'matthiasc/for-main' into 'main'
gsk: Inline some more rect functions

See merge request GNOME/gtk!6755
2024-01-14 22:37:02 +00:00
Matthias Clasen
cdbfb35067 rendernode-tool: Make test fonts available
We are likely to use the tool with node files from out testsuite,
which may now refer to custom test fonts, so make them available
in the same way as in the node editor.

If in doubt, you can set GTK_SOURCE_DIR to make the tool find the
fonts.
2024-01-14 16:58:05 -05:00
Matthias Clasen
53e17ab14e Merge branch 'node-editor-autosave' into 'main'
node-editor: Add an auto-reload property

See merge request GNOME/gtk!6757
2024-01-14 21:51:19 +00:00
Matthias Clasen
550e98090a node-editor: Redo crash recovery UX
Switch from a dialog to an in-app notification, and make use
of the new auto-reload property for it.
2024-01-14 14:40:51 -05:00
Matthias Clasen
2771befdd9 node-editor: Add a menu items for auto reloading
Expose the auto-reload property as a toggle action, and add
a menu item for it.
2024-01-14 14:40:51 -05:00
Matthias Clasen
911730493d node-editor: Add an auto-reload property
This is not exposed anywhere yet.
2024-01-14 14:40:51 -05:00
Maximiliano Sandoval
d05f47a695
popovermenu: Add default sliding flag
Also add missing annotation.

Continuation of https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6298
2024-01-14 16:32:20 +01:00
Quentin PAGÈS
11dc15207e Update Occitan translation 2024-01-14 11:32:22 +00:00
Matthias Clasen
4ea748a676 Merge branch 'matthiasc/for-main' into 'main'
Add another font rendering test

See merge request GNOME/gtk!6752
2024-01-14 01:16:57 +00:00
Matthias Clasen
b78d2a7f75 Add another font rendering test
This one tests that we handle glyphs with lsb correctly wrt. to
positioning.
2024-01-13 17:47:27 -05:00
Benjamin Otte
1fd9e1e916 Merge branch 'wip/otte/benchmark' into 'main'
Add gtk-rendernode-tool benchmark

See merge request GNOME/gtk!6751
2024-01-13 17:20:45 +00:00
Benjamin Otte
24ceb47cbc tools: Add the new benchmark command to the docs 2024-01-13 17:22:57 +01:00
Benjamin Otte
8872e1cbb0 tools: Add gtk-rendernode-tool benchmark
A simple tool that runs gsk_renderer_render_texture() a few times with
every renderer and prints the results.
2024-01-13 17:22:57 +01:00
Benjamin Otte
c1e2ffac83 tools: Split out a function
There's a function now that creates a renderer by name - and allows NULL
for the default renderer
2024-01-13 17:22:57 +01:00
Piotr Drąg
17df646663 Update POTFILES.in 2024-01-13 13:29:25 +01:00
Ngọc Quân Trần
6f8fae590f Update Vietnamese translation
(cherry picked from commit cbc44e202a)
2024-01-13 07:19:30 +00:00
Matthias Clasen
4146db0003 Merge branch 'matthiasc/for-main' into 'main'
glarea: Add some details to the docs

Closes #6317

See merge request GNOME/gtk!6749
2024-01-13 03:17:05 +00:00
Matthias Clasen
9c228cc634 glarea: Add some details to the docs
Mention that the rendering is integrated into the GTK scene graph
as a texture and that the initial framebuffer contents are
transparent.

Fixes: #6317
2024-01-12 21:58:44 -05:00
Matthias Clasen
df2cdb6913 Merge branch 'node-editor-autosave' into 'main'
node-editor: Add autosave

See merge request GNOME/gtk!6748
2024-01-13 02:30:06 +00:00
Matthias Clasen
22a5447039 docs: Document new node-editor options 2024-01-12 21:13:51 -05:00
Matthias Clasen
a2475051fa Merge branch 'use-modifier-none' into 'main'
Use GDK_NO_MODIFIER_MASK in default prop values

See merge request GNOME/gtk!6747
2024-01-13 01:55:12 +00:00
Matthias Clasen
d41fb7c5a6 node-editor: Add commandline options
Add --reset to remove the autosave file. While we're at it, also
add --version.
2024-01-12 20:50:34 -05:00
Matthias Clasen
3b28c46595 node-editor: Add autosave
Save the buffer contents to a file in ~/.cache/gtk4-node-editor
and restore it on startup.
2024-01-12 20:50:34 -05:00
Maximiliano Sandoval
f57300b924
Use GDK_NO_MODIFIER_MASK in default prop values 2024-01-13 01:30:02 +01:00
Matthias Clasen
c146f225ff Merge branch 'big-glyph-test' into 'main'
gsk: Fix big glyphs getting clipped

See merge request GNOME/gtk!6744
2024-01-12 21:31:35 +00:00
Matthias Clasen
9f4f65be4a gsk: Add test for clipped big glyphs
Tests the fix in the previous commit 93715b963e.

Sadly, the flipped variant of this test fails with the cairo
renderer, so it is marked as -nocairo. All the other renderers
pass it.
2024-01-12 16:02:05 -05:00
Matthias Clasen
93715b963e gsk: Fix big glyphs getting clipped
We were inadvertedly shifting the rendering by one pixel.
2024-01-12 15:55:27 -05:00
Benjamin Otte
c1407f2ca6 Merge branch 'wip/otte/for-main' into 'main'
gpu: Remove unnecessary optimization

Closes #6322

See merge request GNOME/gtk!6743
2024-01-12 19:23:46 +00:00
Benjamin Otte
3b299f574d testsuite: Add a test for contained clips
Related: #6322
2024-01-12 20:06:04 +01:00
Benjamin Otte
a51c6aed47 gpu: Introduce "contained" clip
This clip is different from "none" in that the bounds rect cannot be
ignored and that potential drawing outside the clip must be avoided.

In particular it means that clip nodes cannot be discarded if they
encompass the full clip region.

Fixes #6322
2024-01-12 20:06:04 +01:00
Benjamin Otte
b552cf74dd gpu: Remove unnecessary optimization
Every branch in the switch is so optimized that it does this check
early anyway, so there's no need to have it as an extra step.
2024-01-12 20:06:04 +01:00