Fully prevent client commands on input only sessions

This commit is contained in:
Yukino Song
2025-02-05 11:16:27 +08:00
parent 5c36b89103
commit 9c5c90e64b
3 changed files with 14 additions and 2 deletions

View File

@@ -1053,7 +1053,7 @@ namespace nvhttp {
if (!!(named_cert_p->perm & PERM::_all_actions)) {
auto current_appid = proc::proc.running();
auto input_only_id_int = util::from_view(proc::input_only_app_id);
auto should_hide_inactive_apps = config::input.enable_input_only_mode && rtsp_stream::session_count() != 0 && current_appid != input_only_id_int;
auto should_hide_inactive_apps = config::input.enable_input_only_mode && current_appid > 0 && current_appid != input_only_id_int;
for (auto &app : proc::proc.get_apps()) {
auto appid = util::from_view(app.id);
if (should_hide_inactive_apps && appid != current_appid && appid != input_only_id_int) {
@@ -1161,6 +1161,9 @@ namespace nvhttp {
if (is_input_only) {
BOOST_LOG(info) << "Launching input only session..."sv;
launch_session->client_do_cmds.clear();
launch_session->client_undo_cmds.clear();
// Still probe encoders once, if input only session is launched first
// But we're ignoring if it's successful or not
if (rtsp_stream::session_count() == 0 && !proc::proc.virtual_display) {