Skip to content

Commit

Permalink
Make sure the Host Registry XdpAppInfo updates become visible
Browse files Browse the repository at this point in the history
The invocations are currently delegated to threads which means that the
next invocation gets run before the first one finished. This is fine for
all the other portals, but because the Registry modifies the identity of
the caller for all following calls, we must ensure that it finishes
before the next invocation. This means in particular no
g-authorize-method and no FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD.
  • Loading branch information
swick authored and jadahl committed Feb 26, 2025
1 parent f7837cc commit e71bb95
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/xdg-desktop-portal.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ static void
export_host_portal_implementation (GDBusConnection *connection,
GDBusInterfaceSkeleton *skeleton)
{
/* Host portal dbus method invocations run in the main thread without yielding
* to the main loop. This means that any later method call of any portal will
* see the effects of the host portal method call.
*
* This is important because the Registry modifies the XdpAppInfo and later
* method calls must see the modified value.
*/

g_autoptr(GError) error = NULL;

if (skeleton == NULL)
Expand All @@ -201,7 +209,7 @@ export_host_portal_implementation (GDBusConnection *connection,
}

g_dbus_interface_skeleton_set_flags (skeleton,
G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD);
G_DBUS_INTERFACE_SKELETON_FLAGS_NONE);

if (!g_dbus_interface_skeleton_export (skeleton,
connection,
Expand Down

0 comments on commit e71bb95

Please sign in to comment.