This commit is contained in:
Yukino Song
2025-02-06 05:28:59 +08:00
parent 786fadb960
commit eb3a764163

View File

@@ -962,10 +962,10 @@ namespace nvhttp {
tree.put("root.PairStatus", pair_status);
if constexpr (std::is_same_v<SunshineHTTPS, T>) {
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.