diff --git a/data/org.freedesktop.portal.documents.xml b/data/org.freedesktop.portal.documents.xml index 3acf79eb..c61381a5 100644 --- a/data/org.freedesktop.portal.documents.xml +++ b/data/org.freedesktop.portal.documents.xml @@ -25,6 +25,9 @@ + + + diff --git a/document-portal/xdp-fuse.c b/document-portal/xdp-fuse.c index b6feea68..5d2fd099 100644 --- a/document-portal/xdp-fuse.c +++ b/document-portal/xdp-fuse.c @@ -1724,6 +1724,12 @@ static struct fuse_session *session = NULL; static struct fuse_chan *main_ch = NULL; static char *mount_path = NULL; +const char * +xdp_fuse_get_mountpoint (void) +{ + return mount_path; +} + void xdp_fuse_exit (void) { diff --git a/document-portal/xdp-fuse.h b/document-portal/xdp-fuse.h index f335ccc8..f2ef11d3 100644 --- a/document-portal/xdp-fuse.h +++ b/document-portal/xdp-fuse.h @@ -9,6 +9,7 @@ G_BEGIN_DECLS gboolean xdp_fuse_init (XdpDocDb *db, GError **error); void xdp_fuse_exit (void); +const char * xdp_fuse_get_mountpoint (void); G_END_DECLS diff --git a/document-portal/xdp-main.c b/document-portal/xdp-main.c index 7cd1ad3e..fc250f1e 100644 --- a/document-portal/xdp-main.c +++ b/document-portal/xdp-main.c @@ -347,6 +347,13 @@ handle_method (GCallback method_callback, return TRUE; } +static gboolean +handle_get_mount_point (XdpDbusDocuments *object, GDBusMethodInvocation *invocation) +{ + xdp_dbus_documents_complete_get_mount_point (object, invocation, xdp_fuse_get_mountpoint ()); + return TRUE; +} + static void on_bus_acquired (GDBusConnection *connection, const gchar *name, @@ -357,6 +364,7 @@ on_bus_acquired (GDBusConnection *connection, helper = xdp_dbus_documents_skeleton_new (); + g_signal_connect_swapped (helper, "handle-get-mount-point", G_CALLBACK (handle_get_mount_point), NULL); g_signal_connect_swapped (helper, "handle-add", G_CALLBACK (handle_method), portal_add); g_signal_connect_swapped (helper, "handle-add-local", G_CALLBACK (handle_method), portal_add_local); g_signal_connect_swapped (helper, "handle-grant-permissions", G_CALLBACK (handle_method), portal_grant_permissions);