From: Matthias Clasen Date: Wed, 7 Sep 2022 03:38:08 +0000 (-0400) Subject: Make the file transfer portal setup sync again X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2~2^2~23^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b756aa0764b9dd8fa3ec629b681ba303bfc90575;p=gtk4.git Make the file transfer portal setup sync again We need to register the portal mime types before the others to prefer them, doing this call async messes up that ordering. This is effectively reverting 69fb3648b2e20935b7839f874 --- diff --git a/gdk/filetransferportal.c b/gdk/filetransferportal.c index a658d086a8..fac2ab213c 100644 --- a/gdk/filetransferportal.c +++ b/gdk/filetransferportal.c @@ -480,20 +480,8 @@ connection_closed (GDBusConnection *connection, } static void -got_proxy (GObject *source, - GAsyncResult *result, - gpointer data) +finish_registration (void) { - GError *error = NULL; - - file_transfer_proxy = g_dbus_proxy_new_for_bus_finish (result, &error); - if (!file_transfer_proxy) - { - g_message ("Failed to get file transfer portal: %s", error->message); - g_clear_error (&error); - return; - } - gdk_content_register_serializer (G_TYPE_FILE, "application/vnd.portal.files", portal_file_serializer, @@ -531,7 +519,8 @@ file_transfer_portal_register (void) if (!called) { called = TRUE; - g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, + + file_transfer_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS | G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, @@ -540,8 +529,9 @@ file_transfer_portal_register (void) "/org/freedesktop/portal/documents", "org.freedesktop.portal.FileTransfer", NULL, - got_proxy, NULL); + if (file_transfer_proxy) + finish_registration (); } }