From fca2b744198c2d7f1fdffa67cb514583f09d8620 Mon Sep 17 00:00:00 2001 From: ALI EFE CAKICI Date: Sun, 22 Mar 2026 19:29:33 +0300 Subject: [PATCH] fix: clear tray icon when unpairing the last paired client Fixes #4801 When unpairing the only remaining paired device, the tray icon stayed stuck on 'Game Session Paused' instead of returning to idle. This happened because single-client unpair removed the client record but did not terminate the running app/session state like 'unpair all' does. This change calls proc::proc.terminate() when the last paired client is removed, mirroring the existing cleanup behavior in the unpair-all path. --- src/confighttp.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/confighttp.cpp b/src/confighttp.cpp index 3d354bd3952..4a0bb128016 100644 --- a/src/confighttp.cpp +++ b/src/confighttp.cpp @@ -879,7 +879,13 @@ namespace confighttp { nlohmann::json output_tree; const nlohmann::json input_tree = nlohmann::json::parse(ss); const std::string uuid = input_tree.value("uuid", ""); - output_tree["status"] = nvhttp::unpair_client(uuid); + const bool removed = nvhttp::unpair_client(uuid); + output_tree["status"] = removed; + + if (removed && nvhttp::get_all_clients().empty()) { + proc::proc.terminate(); + } + send_response(response, output_tree); } catch (std::exception &e) { BOOST_LOG(warning) << "Unpair: "sv << e.what();