Commit Graph

32271 Commits

Author SHA1 Message Date
Philip Withnall
bbc508b78f gnetworkmonitorbase: Add missing notify::connectivity signal
The connectivity is directly derived from the `is_available` variable,
so if that changes, we need to notify of a change in `connectivity` too.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #3803
2025-10-20 16:15:45 +01:00
Marco Trevisan
0c89c8532f Merge branch 'reenable-msys2-ci' into 'main'
Reenable MSYS2 CI

See merge request GNOME/glib!4870
2025-10-20 15:31:27 +02:00
Luca Bacci
93c8884761 CI/MSYS2: Set GitLab submodule strategy to recursive
Workaround for #3715
2025-10-20 10:51:32 +02:00
Luca Bacci
aa9a861225 Revert "ci: Temporarily disable msys2-mingw32 CI"
This reverts commit 558a34d619.
2025-10-20 10:50:33 +02:00
Philip Withnall
855326b5bf Merge branch 'win32-app-info-cleanup' into 'main'
GIO/Win32: Remove custom definitions of system interfaces

See merge request GNOME/glib!4753
2025-10-17 12:25:56 +00:00
Philip Withnall
74f0c6d7cd Merge branch 'add-back-type-refs' into 'main'
gtype: Define copy and free functions for GTypeClass and GTypeInterface

See merge request GNOME/glib!4792
2025-10-17 10:08:09 +00:00
Luca Bacci
5a3231dbda GIO/Win32: Remove custom definitions of system interfaces 2025-10-17 10:46:01 +02:00
Marco Trevisan (Treviño)
2ce48fcb0c gtype: Use transfer none for types (un)ref functions
We have some (deprecated) methods that technically still return
transfer-full instances of GTypeClass's and GTypeInterface's.

The introspection scanner cannot generate bindings for them though since
it does not know how to manage their lifecycle, and we end up skipping
these symbols.

This is breaking some language bindings, and in particular gjs [1] and
lua-lgi, that were using the .ref methods.

While we should not use deprecated functions in the language bindings,
these symbols should still be introspected.

[1] https://gitlab.gnome.org/GNOME/gjs/-/issues/711

Partially reverts commit cad84d5e27.
2025-10-17 04:15:03 +02:00
Marco Trevisan
618d45cc83 Merge branch 'snap-document-portal-launch' into 'main'
GDesktopAppInfo: Use document portal to open all the URIs for snaps

See merge request GNOME/glib!4822
2025-10-17 04:00:20 +02:00
Marco Trevisan
6c980a1242 Merge branch 'bump-fedora-ci' into 'main'
ci: Update Fedora CI image to Fedora 41

See merge request GNOME/glib!4864
2025-10-17 03:54:21 +02:00
Marco Trevisan (Treviño)
bc35a1496d gio/gdesktopappinfo: Also use document portal for desktop file snaps
When a snap is launched from its non-dbus-activable desktop file we may
still need to use the portal to pass the URIs to the program, so that it
can access to them even if confined.

In fact most snaps are not dbus-activable, but they rely on the classic
desktop file activation.
2025-10-17 03:48:55 +02:00
Marco Trevisan
bd4b57e811 Merge branch 'scan-build-fixes' into 'main'
Fix various scan-build errors

See merge request GNOME/glib!4866
2025-10-17 03:47:16 +02:00
Philip Withnall
0eb35e8032 compiler: Fix a scan-build false positive about a file handle leak
Seems scan-build is incorrectly assuming that `output != NULL` at the start
of the function (so `file` is opened), and then later assuming that
`output == NULL` (so `file` is not closed).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-17 00:30:18 +01:00
Philip Withnall
d904f77770 gunixmounts: Silence a scan-build false positive about a file handle leak
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-17 00:27:02 +01:00
Philip Withnall
ff9b245b6a gspawn-posix: Fix error reporting if dup(child_err_report_fd) fails
Keep the old error reporting FD around until duping it has worked,
otherwise we don’t have an FD to report errors on.

Spotted by scan-build.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-17 00:10:16 +01:00
Marco Trevisan (Treviño)
29fdcec8f3 gio/tests/desktop-app-info: Check child exit status
We need to ensure that the child we launch is not failing otherwise it
won't be possible to catch any assertion failure that it may happen
2025-10-17 01:07:33 +02:00
Philip Withnall
daf3bd7f0a gmappedfile: Avoid calling mmap() with a length of zero
We were previously relying on it returning `EINVAL` so we could return
an error message, but scan-build doesn’t like that, so let’s just
explicitly return the same error anyway to shut scan-build up.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-17 00:03:04 +01:00
Philip Withnall
ca1e32f067 grand: Avoid reading an undefined value from errno
The value of `errno` can apparently be undefined after a successful
function call (according to scan-build), so only check `errno` on
failure.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-16 23:56:43 +01:00
Philip Withnall
3e1176e4b8 Merge branch 'socket-control-docs' into 'main'
gsocketcontrolmessage: Fix a minor typo in a doc comment

See merge request GNOME/glib!4858
2025-10-16 21:10:46 +00:00
Philip Withnall
0ab1866145 Merge branch '3798-appinfo-portal-crash' into 'main'
gopenuriportal: Fix a crash when the file can’t be opened

Closes #3798

See merge request GNOME/glib!4859
2025-10-16 21:04:12 +00:00
Philip Withnall
3179f9b57c Merge branch 'gvariant-diagram-reuse-data' into 'main'
Docs: Migrate gvariant-*.svg licenses to comments

See merge request GNOME/glib!4857
2025-10-16 20:26:49 +00:00
Marco Trevisan (Treviño)
23c2483703 gio/gdesktopappinfo: Use document portal to open URIs for dbus-started snaps
Snap applications like flatpak apps may need to use the portals to open
files, so use the same logic that we have for flatpaks but using the
snap ID that matches portal expectations
2025-10-16 22:12:00 +02:00
Philip Withnall
21179497cf Merge branch 'zero-terminated-annotations' into 'main'
gio: add some nullable / zero-terminated annotations

See merge request GNOME/glib!4789
2025-10-16 20:10:49 +00:00
Marco Trevisan (Treviño)
85ec0256fe gio/tests/dbus-appinfo: Ensure that a dbus application has been opened
We were checking the results of opening an sandboxed application, but
never if the open was actually invoked.

So if another desktop file was used in tests, we were never getting any
failure, at least not related to the lack of a file being opened
2025-10-16 22:10:14 +02:00
Marco Trevisan (Treviño)
3159c3f806 dbus-appinfo: Generalize the flatpak appplication as a sandboxed app
So that we can use it for both flatpaks and snaps
2025-10-16 22:05:27 +02:00
Philip Withnall
fda9ab69f9 Merge branch 'gapplication-test-check-parameters' into 'main'
gio/tests/gapplication: Check the values received on action activation

See merge request GNOME/glib!4861
2025-10-16 19:51:45 +00:00
FeRD (Frank Dana)
fabe2113c3 Docs: Migrate gvariant-*.svg licenses to comments
Remove the overrides in `.reuse/dep5`, and instead store the license
information in a comment near the top of each file.
2025-10-16 19:37:00 +00:00
FeRD (Frank Dana)
4906e179c1 REUSE: Add missing AFL-2.0 and CC-BY-SA-3.0 texts 2025-10-16 19:37:00 +00:00
François Laignel
7d032f2fde gio: add some nullable / zero-terminated annotations 2025-10-16 19:36:56 +00:00
Philip Withnall
5917bce3de gopenuriportal: Fix a crash when the file can’t be opened
Rather than reporting an error via a new `GTask`, report it via the
`GTask` we’ve already created. This avoids a critical warning about
destroying the `GTask` without returning a result.

Also ensure to disconnect the D-Bus signal subscription first, to avoid
an assertion failure in `call_data_free()`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #3798
2025-10-16 20:28:19 +01:00
Philip Withnall
9b03809a16 gsocketcontrolmessage: Fix a minor typo in a doc comment
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-16 20:28:01 +01:00
Philip Withnall
f695a6156c gmacros: Use 202000L as __STDC_VERSION__ for C23
202311L is the canonical value for C23 (as per
https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html), but
gcc 14 implemented almost all of the spec (see
https://en.cppreference.com/w/c/compiler_support/23) and it defines
`__STDC_VERSION__` to `202000L` when building with `c_std=c23`, so we’d
better go with that.

Fixes the `macros-c-23` test on gcc 14.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-16 20:25:09 +01:00
Marco Trevisan (Treviño)
b3a7c087ee gio/tests/gapplication: Check the values received on action activation
As per commit 0144feb41 the activate action paramter may pack multiple
values but while the behavior was checked we did not check the content
of the values we were receiving in the action callback.

So, also ensure that the variant values we receive are matching the
expectations.
2025-10-16 19:16:26 +00:00
Marco Trevisan
6c7193acb3 Merge branch 'document-portal-fix-symlink-names' into 'main'
gio/gdocumentportal: Use the target name when opening a symlink

See merge request GNOME/glib!4823
2025-10-16 21:11:01 +02:00
Philip Withnall
c8d56c10ce tests: Add debug for G_C_STD_VERSION
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-16 19:40:17 +01:00
Marco Trevisan (Treviño)
085deb7697 gio/tests/documentportal: Add tests covering portal failures
In case the portal fails to create what we expect, or we can't read the
files we should fail. Add test cases for this too.
2025-10-16 20:29:32 +02:00
Marco Trevisan (Treviño)
fb0ee7562b gio/gdocumentportal: Get portal file name by listing the mount point
Instead of guessing the portal file name by using the original file name
let's just inspect the portal document ID directory and get the actual
file name
2025-10-16 20:29:32 +02:00
Marco Trevisan (Treviño)
a3b99ce554 gio/tests/fake-document-portal: Really create fake files
In order to properly test the document portal, let's also create some
dummy files that are named after the FDs we receive and using the
document-id path as the real portal does
2025-10-16 20:29:32 +02:00
Marco Trevisan (Treviño)
eb78cfeeca gio/tests/fake-document-portal: Test that the app-id matches the request
Ensure that the app-id requiring the document matches the one we want,
so that we can actually test the code in GDesktopAppInfo that does the
mapping
2025-10-16 20:29:32 +02:00
Marco Trevisan (Treviño)
3eb2abb406 fake-document-portal: Fix signature of function callback
We were missing a parameter, as per the generated bindings
2025-10-16 20:29:32 +02:00
Marco Trevisan (Treviño)
352cfe600a gio/gdocumentportal: Use the target name when opening a symlink
When an URI to a symlink is added to the portal, we open it and we send
the FD (of the target) to the portal. This one has no clue about the original
symlink and so it mounts a file that is named like the target.

g_document_portal_add_documents(), however returns a path that contains
the original name and that one is what is sent to the applications when
used via GDesktopAppInfo.

Basically, this is the situation:
  - /tmp/symlink -> /tmp/target
  - An application is launched to open file:/tmp/symlink
  - The portal creates file:/$XDG_RUNTIME_DIR/doc/ID/target
  - Gio converts the path to file:/$XDG_RUNTIME_DIR/doc/ID/symlink

Now, since we can't just pass the symlink to the portal without also
changing the logic there, it's just better to do the conversion ourself,
and so, we use the already-opened fd to figure out the real path of the
opened file, and we return a document file URI that uses the target
basename instead
2025-10-16 20:29:32 +02:00
Marco Trevisan (Treviño)
d81701de56 gio/tests: Add document portal tests
While this can be tested using desktop apps, adding some unit tests
makes simpler to verify the edge cases
2025-10-16 20:29:32 +02:00
Marco Trevisan (Treviño)
ddc324da03 gio/tests/fake-document-portal: Use a sequential ID for docs
It makes things clearer to test
2025-10-16 20:29:32 +02:00
Philip Withnall
ea31be5472 Merge branch 'disable-mingw32-ci' into 'main'
ci: Temporarily disable msys2-mingw32 CI

See merge request GNOME/glib!4863
2025-10-16 17:41:20 +00:00
Philip Withnall
de5521cd27 ci: Update Fedora CI image to Fedora 41
Fedora 39 is out of support so, as per our policy, update the CI image
to the oldest still-supported release, which is 41.

systemtap-sdt-dtrace needs to be installed separately (for the `dtrace`
binary), as it appears to have been split out of some other package.

Update the mingw CI image too, as it’s built on top of the Fedora one.

Update the supported platforms documentation.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-16 18:15:31 +01:00
Philip Withnall
558a34d619 ci: Temporarily disable msys2-mingw32 CI
It routinely fails with subproject fetch errors, typically at least
every second CI run. This wastes a lot of CI machine time, and a little
bit of developer time and energy each time (in noticing that it’s
failed, context switching, checking the failure, retrying it, context
switching again).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
See: https://gitlab.gnome.org/GNOME/glib/-/issues/3715
2025-10-16 16:39:16 +01:00
Philip Withnall
c4a162851d Merge branch 'filename-encodings-diag' into 'main'
Docs: New file-name-encodings image: light/dark, color

See merge request GNOME/glib!4851
2025-10-16 15:07:06 +00:00
Philip Withnall
e77f0a04c5 Merge branch 'glib-compile-resources-print-error-message' into 'main'
glib-compile-resources: print error message when the temp file cannot be created

See merge request GNOME/glib!4855
2025-10-16 14:34:00 +00:00
FeRD (Frank Dana)
c2f6337d8f Docs: New file-name-encodings image: light/dark, color
- Redid the old StarOffice-format drawing file in OpenDocument
  format, and updated with two different `-light` and `-dark`
  versions.
  - Added color to the rectangles
  - Bolded all of the text
  - Added background transparency
- Exported both as `file-name-encodings-{light,dark}.svg`
- Tweaked in Inkscape to simplify SVG structure, scale to
  fixed pixel sizes, align to page dimensions.
- Added License/Copyright data as Custom Document Properties
  in OpenDocument sources, comments in SVG source.
  - Federico Mena Quintero, uploader of the originals, is
    credited in the `SPDX-FileCopyrightText` data, along
    with myself.
  - License chosen was `CC0-1.0`, because again I don't believe
    these files are complex enough to actually be copyrightable.
- Added data for `.odg` files to `/.reuse/dep5` file, as
  reuse can't extract license data from that format.
- Updated `character-set.md` and `glib.toml.in` to use
  new SVGs in place of old PNG.
2025-10-16 13:35:12 +00:00
Luca Bacci
b623031e22 glib-compile-resources: print error message when the temp file cannot be created 2025-10-16 13:16:58 +00:00