From 76e3d5968ceee0c3e948465690145b54ec4f28a1 Mon Sep 17 00:00:00 2001 From: Joao Gomes Date: Mon, 2 Nov 2026 15:55:03 +0100 Subject: [PATCH] fix(linux): build with GLib older than 2.74 G_CONNECT_DEFAULT was added in GLib 2.74. Ubuntu 22.04 ships GLib 2.72, so shortcut_portal_linux.cpp does not compile there, and the whole library fails to build. Pass the value 0 directly, the same flags value on every GLib version. --- src/platform/linux/shortcut_portal_linux.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/linux/shortcut_portal_linux.cpp b/src/platform/linux/shortcut_portal_linux.cpp index 2dafb5e..0ba1e48 100644 --- a/src/platform/linux/shortcut_portal_linux.cpp +++ b/src/platform/linux/shortcut_portal_linux.cpp @@ -418,6 +418,7 @@ struct ShortcutPortalLinux::State : std::enable_shared_from_this { } else { item->connection = connection; g_dbus_connection_set_exit_on_close(connection, false); + // G_CONNECT_DEFAULT (0) is GLib 2.74+; older distributions have no name for it. g_signal_connect_data(connection, "closed", G_CALLBACK(+[](GDBusConnection*, gboolean, GError*, gpointer data) { auto* weak = static_cast*>(data); @@ -426,7 +427,7 @@ struct ShortcutPortalLinux::State : std::enable_shared_from_this { } }), new std::weak_ptr(item), +[](gpointer data, GClosure*) { delete static_cast*>(data); }, - G_CONNECT_DEFAULT); + static_cast(0)); self->Subscribe(item); self->RegisterHost(item); }