From 9a1c14127fd135a6bf6abbf5d57ae1a2961bf4d0 Mon Sep 17 00:00:00 2001 From: Joan Torres Date: Thu, 4 Apr 2024 13:40:02 +0200 Subject: [PATCH] sharing: Stop assigned services only when no network connection This allows grd handover service to be started even with network access through a mobile device or when the network access is from Wi-Fi. --- plugins/sharing/gsd-sharing-manager.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/sharing/gsd-sharing-manager.c b/plugins/sharing/gsd-sharing-manager.c index 7713569f..2ab2cb05 100644 --- a/plugins/sharing/gsd-sharing-manager.c +++ b/plugins/sharing/gsd-sharing-manager.c @@ -297,7 +297,7 @@ start_assigned_service (GsdSharingManager *manager, { AssignedService *service; - if (manager->sharing_status != GSD_SHARING_STATUS_AVAILABLE) + if (manager->sharing_status == GSD_SHARING_STATUS_OFFLINE) return; if (!info->system_service_running) @@ -414,10 +414,10 @@ gsd_sharing_manager_sync_assigned_services (GsdSharingManager *manager) for (l = services; l != NULL; l = l->next) { AssignedServiceInfo *info = l->data; - if (manager->sharing_status == GSD_SHARING_STATUS_AVAILABLE) - start_assigned_service (manager, info); - else + if (manager->sharing_status == GSD_SHARING_STATUS_OFFLINE) stop_assigned_service (manager, info); + else + start_assigned_service (manager, info); } g_list_free (services); } -- 2.44.0