From eb3a764163f5780f5d48f34bcc037f2af8ac62b0 Mon Sep 17 00:00:00 2001 From: Yukino Song Date: Thu, 6 Feb 2025 05:28:59 +0800 Subject: [PATCH] Fix #329 --- src/nvhttp.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/nvhttp.cpp b/src/nvhttp.cpp index 4f8d597a..d87b7d7c 100644 --- a/src/nvhttp.cpp +++ b/src/nvhttp.cpp @@ -962,10 +962,10 @@ namespace nvhttp { tree.put("root.PairStatus", pair_status); if constexpr (std::is_same_v) { - int current_appid = 0; + int current_appid = proc::proc.running(); // When input only mode is enabled, the only resume method should be launching the same app again. - if (!config::input.enable_input_only_mode) { - current_appid = proc::proc.running(); + if (config::input.enable_input_only_mode && current_appid != proc::input_only_app_id) { + current_appid = 0; } tree.put("root.currentgame", current_appid); tree.put("root.state", proc::proc.running() > 0 ? "SUNSHINE_SERVER_BUSY" : "SUNSHINE_SERVER_FREE"); @@ -1187,6 +1187,10 @@ namespace nvhttp { launch_session->client_undo_cmds.clear(); } + if (current_appid == proc::input_only_app_id) { + launch_session->input_only = true; + } + if (no_active_sessions && !proc::proc.virtual_display) { display_device::configure_display(config::video, *launch_session); if (video::probe_encoders()) { @@ -1302,6 +1306,10 @@ namespace nvhttp { launch_session->client_undo_cmds.clear(); } + if (config::input.enable_input_only_mode && current_appid == proc::input_only_app_id) { + launch_session->input_only = true; + } + if (no_active_sessions && !proc::proc.virtual_display) { // We want to prepare display only if there are no active sessions // and the current session isn't virtual display at the moment.