Commit Graph

78966 Commits

Author SHA1 Message Date
Matthias Clasen
4733ca193b inspector: Show git sha for the build 2024-01-18 20:22:00 -05:00
Matthias Clasen
c7b345f73e build: Move and rename demo_conf.h header
We want to use the same header in the inspector, so move it to
the toplevel. And since it is no longer for demos only, rename
it to profile_conf.h, and also rename the build option back
to profile.
2024-01-18 20:20:58 -05:00
Matthias Clasen
1fbc61f2cb Merge branch 'static_text_widgets_are_not_special' into 'main'
a11y: Remove special handling of accessible names for static text widgets

See merge request GNOME/gtk!6776
2024-01-18 16:01:29 +00:00
Matthias Clasen
565694ede5 Merge branch 'wip/chergert/fix-expression-weak-ref-uaf' into 'main'
expression: use indirection to safely finalize object expression

See merge request GNOME/gtk!6778
2024-01-18 16:00:55 +00:00
Christian Hergert
0df03b054d expression: guard against UAF with indirection
When using g_object_weak_ref(), it is important that you can discover
weather or not it is safe to call g_object_weak_unref(). That is
problematic if you use a naked pointer to structure. Additionally,
if a GWeakRef is used, and things are not cleaned up carefully,
GObject itself will try to write to it. So ensuring that the GWeakRef
is cleared safely before the owning struct is finalized is paramount.
That is difficult if you are unsure wheather or not your weak_ref
callback has been called.

This introduces WeakRefGuard which is an indirection pointer that is
cleared on the first unref. There are only ever two references. When
the owning struct is finalized or the weak ref callback is called, an
unref will occur and the guard will clear the data pointer.
2024-01-17 19:25:31 -08:00
Christian Hergert
73d01d3130 expression: release target if evaulation fails
Related #6341
2024-01-17 19:25:00 -08:00
Matthias Clasen
80f3357117 Merge branch 'dboles/Notebook-DropTarget-GTK4' into 'main'
Notebook: Update doc on how to accept dropped tabs

See merge request GNOME/gtk!6450
2024-01-18 02:28:18 +00:00
Lukáš Tyrychtr
d5b34aecdd a11y: Remove special handling of accessible names for static text widgets
By doing this, we gain the capability to send notifications when their
accessible names change. Also, it simplifies the accessible name
generation logic.
2024-01-17 12:49:38 +01:00
Matthias Clasen
d16d2135e6 Merge branch 'demos-fix-commit-sha' into 'main'
Flatpak demos fix missing commit sha

See merge request GNOME/gtk!6774
2024-01-17 02:51:35 +00:00
Matthias Clasen
53b52abd30 Merge branch 'matthiasc/for-main' into 'main'
Shrink the repeat-repeats tests

See merge request GNOME/gtk!6775
2024-01-17 02:40:22 +00:00
Matthias Clasen
e55e9e3b36 Shrink the repeat-repeats tests
This was triggering timeouts in ci.
2024-01-16 20:58:02 -05:00
Matthias Clasen
9f9cea219f Merge branch 'dnd-cursor-names' into 'main'
dnd: Use standard cursor names

Closes #6337

See merge request GNOME/gtk!6770
2024-01-17 01:33:41 +00:00
Matthias Clasen
dbee1a8160 dnd: Use standard cursor names
The css spec doesn't cover the fringe 'ask' feature of DND, but
apart from that, we should use the names in the spec.

Fixes: #6337
2024-01-16 19:45:53 -05:00
Matthias Clasen
133cd87bdf Merge branch 'ebassi/doc-fixes' into 'main'
docs: Clean up the note on nVidia on Windows

See merge request GNOME/gtk!6773
2024-01-17 00:20:35 +00:00
Benjamin Otte
9f8e84cb60 Merge branch 'wip/otte/for-main' into 'main'
gl: BGRA formats need a different internal format

Closes #6333

See merge request GNOME/gtk!6772
2024-01-16 21:21:17 +00:00
Emmanuele Bassi
b8057b088e docs: Clean up the note on nVidia on Windows
Turn the URL to the nVidia forums into an actual link, and put the whole
paragraph into an aside.
2024-01-16 20:14:21 +00:00
Jan Willem Eriks
cf8cca8724
Flatpak builds pass the commit sha as environment variable
This variable is refrenced at build-aux/meson/gen-demo-header.py but never passed to the flatpak builder.
This fixes that the flatpak build don't have their commit in the about window.
2024-01-16 20:45:01 +01:00
Benjamin Otte
d97767014c gl: BGRA formats need a different internal format
In GLES, BGRA is still done by GL_EXT_texture_format_BGRA8888 which is
an extension that is older than GLES 2.0.

And back then, internal formats had to be specified unsized. And when
that was changed with GLES3, nobody updated the extension.
However, on OpenGL, this extension doesn't exist, and internal formats
need to be sized.

So let's use different internal formats depending on GL version.

Fixes #6333
2024-01-16 20:35:20 +01:00
Benjamin Otte
2f974a1f5a gl: Split internal format for GdkMemoryFormat into GL/GLES
This commit just duplicates the struct.

It's separate because it's just a bunch of boilerplate.
2024-01-16 20:35:20 +01:00
Benjamin Otte
4e2c7d5eb0 gl: Require GL/GLES flag when looking up memory formats
This code just adds the argument to the function and fixes all callers.

It's separate because it's just a bunch of boilerplate.
2024-01-16 20:35:20 +01:00
Emmanuele Bassi
a5d1cb93ef Merge branch 'ebassi/flatpak-no-vulkan' into 'main'
ci: Really disable Vulkan for Flatpak bundles

See merge request GNOME/gtk!6769
2024-01-16 16:31:38 +00:00
Emmanuele Bassi
401b902cbf ci: Really disable Vulkan for Flatpak bundles
We don't use the config options from the manifest to build GTK.
2024-01-16 15:56:58 +00:00
Matthias Clasen
9f2778b97c Merge branch 'fallback-6298' into 'main'
popovermenu: Add default sliding flag

See merge request GNOME/gtk!6746
2024-01-16 13:41:58 +00:00
Matthias Clasen
ed4eeb8adb Merge branch 'wip/chergert/fix-object-expression-notify' into 'main'
expression: combine GWeakNotify and GWeakRef for object expression

Closes #5542 and #6220

See merge request GNOME/gtk!6763
2024-01-16 13:34:08 +00:00
Matthias Clasen
fb36d30685 Merge branch 'custom-font-url' into 'main'
gsk: Keep a fontmap reference in text nodes

See merge request GNOME/gtk!6759
2024-01-16 13:04:13 +00:00
Matthias Clasen
385b9a7241 gsk: Serialize custom fonts with url
If we see custom fonts when serializeing text nodes, write data
url that contains the font file, the first time we see it.

This does not add blobs standard fonts, like Cantarell or Monospace.

Update all affected nodeparser tests.
2024-01-16 07:04:45 -05:00
Matthias Clasen
c2abf30c46 Revert "node-editor: Make test fonts available"
This reverts commit 4882514234.

We can now put custom fonts into node files, so there is
no more need for this.
2024-01-16 07:04:45 -05:00
Matthias Clasen
50a47f55d9 Revert "rendernode-tool: Make test fonts available"
This reverts commit cdbfb35067.

We can now put custom fonts into node files, so there is
no more need for this.
2024-01-16 07:04:45 -05:00
Matthias Clasen
cd7fe772a7 tests: Drop fontconfig setup for custom fonts
We are putting custom fonts into node files now, so there is
no more need for this.
2024-01-16 07:04:45 -05:00
Matthias Clasen
317bba756e Port existing gsk tests to embedded custom fonts
Make all the tests using custom fonts use the new url syntax.
2024-01-16 07:04:45 -05:00
Matthias Clasen
2212049e8f Merge branch 'wip/otte/for-main' into 'main'
Fix infinite loop in zenity

See merge request GNOME/gtk!6767
2024-01-16 11:36:34 +00:00
Matthias Clasen
0f26a006ee Merge branch 'revert-364eec24' into 'main'
Revert "Merge branch 'demos-enable-vulkan' into 'main'"

See merge request GNOME/gtk!6766
2024-01-16 10:15:52 +00:00
Benjamin Otte
3c451b3ec7 columnview: Make sure cells disconnect from their column
When a cell is removed from the columnview, we need to make sure it s
not just removed from the cell (via unset_parent()) but also from the
column.

Previously, we were doing this from dispose(), but this is broken
because dispose() only runs when the refcount goes to zero. But if some
code still has a reference for whatever reason, this won't happen.

So now we do it explicitly together with unset_parent().
2024-01-16 07:20:23 +01:00
Benjamin Otte
323adf9aa8 Revert "gtkcolumnviewcellwidget: move cleanup from dispose to unroot"
This reverts commit ff262c081e.

This is a wrong fix because it triggers when the columnview gets
unrooted but the cell keeps existing. Later, when the columnview gets
re-rooted, the cell is still there but thinks it has no column.

And that's bad.
2024-01-16 06:59:15 +01:00
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