From 64035af066e5a47a0130731db5b3d47df76462fc Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Thu, 23 May 2024 21:08:31 +0200 Subject: [PATCH] Merge pull request #5634 from AenBleidd/vko_fix_shutdown_client_behavior_on_linux [linux][Manager] Allow shutting down local client when run outside of BOINC Manager but not as a daemon --- clientgui/AdvancedFrame.cpp | 2 +- clientgui/BOINCClientManager.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/clientgui/AdvancedFrame.cpp b/clientgui/AdvancedFrame.cpp index 168d2272167..9888d168f4c 100644 --- a/clientgui/AdvancedFrame.cpp +++ b/clientgui/AdvancedFrame.cpp @@ -1141,7 +1141,7 @@ void CAdvancedFrame::OnMenuOpening( wxMenuEvent &event) { wxMenuItem* shutClientItem = menu->FindChildItem(ID_SHUTDOWNCORECLIENT, NULL); if (shutClientItem) { #ifdef __WXGTK__ - shutClientItem->Enable(isConnected && pDoc->m_pClientManager->WasBOINCStartedByManager()); + shutClientItem->Enable(isConnected && (pDoc->m_pClientManager->WasBOINCStartedByManager() || !pDoc->m_pClientManager->IsBOINCConfiguredAsDaemon())); #else shutClientItem->Enable(isConnected); #endif diff --git a/clientgui/BOINCClientManager.cpp b/clientgui/BOINCClientManager.cpp index a336974fdd3..6c16740b8a3 100644 --- a/clientgui/BOINCClientManager.cpp +++ b/clientgui/BOINCClientManager.cpp @@ -443,11 +443,16 @@ void CBOINCClientManager::ShutdownBOINCCore(bool ShuttingDownManager) { wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); -#if defined (__WXMAC__) || defined (__WXGTK__) - // Mac and Linux Manager shuts down client only if Manager started client +#ifdef __WXMAC__ + // Mac Manager shuts down client only if Manager started client if (!m_bBOINCStartedByManager) return; #endif +#ifdef __WXGTK__ + // Linux Manager shuts down client only if Manager started client or client is not a daemon + if (!m_bBOINCStartedByManager && IsBOINCConfiguredAsDaemon()) return; +#endif + #ifdef __WXMSW__ if (IsBOINCConfiguredAsDaemon()) { stop_daemon_via_daemonctrl();