Fully prevent client commands on input only sessions
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -163,7 +163,13 @@ namespace proc {
|
||||
void
|
||||
proc_t::launch_input_only() {
|
||||
_app_id = util::from_view(input_only_app_id);
|
||||
_app_name = "Input Only";
|
||||
allow_client_commands = false;
|
||||
placebo = true;
|
||||
|
||||
#if defined SUNSHINE_TRAY && SUNSHINE_TRAY >= 1
|
||||
system_tray::update_tray_playing(_app_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
@@ -178,6 +184,7 @@ namespace proc {
|
||||
|
||||
_app = app;
|
||||
_app_id = app_id;
|
||||
_app_name = app.name;
|
||||
_launch_session = launch_session;
|
||||
allow_client_commands = app.allow_client_commands;
|
||||
|
||||
@@ -607,6 +614,7 @@ namespace proc {
|
||||
}
|
||||
|
||||
_app_id = -1;
|
||||
_app_name.clear();
|
||||
display_name.clear();
|
||||
initial_display.clear();
|
||||
_launch_session.reset();
|
||||
@@ -639,7 +647,7 @@ namespace proc {
|
||||
|
||||
std::string
|
||||
proc_t::get_last_run_app_name() {
|
||||
return _app.name;
|
||||
return _app_name;
|
||||
}
|
||||
|
||||
boost::process::environment
|
||||
|
||||
@@ -125,6 +125,7 @@ namespace proc {
|
||||
|
||||
private:
|
||||
int _app_id;
|
||||
std::string _app_name;
|
||||
|
||||
boost::process::v1::environment _env;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user