diff --git a/src/nvhttp.cpp b/src/nvhttp.cpp index a2cbe4ba..4f8d597a 100644 --- a/src/nvhttp.cpp +++ b/src/nvhttp.cpp @@ -1053,7 +1053,7 @@ namespace nvhttp { auto named_cert_p = get_verified_cert(request); 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 input_only_id_int = proc::input_only_app_id; 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); @@ -1108,7 +1108,7 @@ namespace nvhttp { auto appid_str = get_arg(args, "appid"); auto appid = util::from_view(appid_str); auto current_appid = proc::proc.running(); - bool is_input_only = config::input.enable_input_only_mode && appid_str == proc::input_only_app_id; + bool is_input_only = config::input.enable_input_only_mode && appid == proc::input_only_app_id; auto named_cert_p = get_verified_cert(request); auto perm = PERM::launch; @@ -1140,7 +1140,7 @@ namespace nvhttp { } if (!is_input_only) { - if (current_appid > 0 && current_appid != util::from_view(proc::input_only_app_id) && appid != current_appid) { + if (current_appid > 0 && current_appid != proc::input_only_app_id && appid != current_appid) { tree.put("root.resume", 0); tree.put("root..status_code", 400); tree.put("root..status_message", "An app is already running on this host"); diff --git a/src/process.cpp b/src/process.cpp index b0c6497b..1a6cf2d8 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -49,7 +49,8 @@ namespace proc { proc_t proc; - std::string input_only_app_id; + int input_only_app_id = -1; + std::string input_only_app_id_str; #ifdef _WIN32 VDISPLAY::DRIVER_STATUS vDisplayDriverStatus = VDISPLAY::DRIVER_STATUS::UNKNOWN; @@ -162,8 +163,8 @@ namespace proc { void proc_t::launch_input_only() { - _app_id = util::from_view(input_only_app_id); - _app_name = "Input Only"; + _app_id = input_only_app_id; + _app_name = "Remote Input"; allow_client_commands = false; placebo = true; @@ -174,7 +175,7 @@ namespace proc { int proc_t::execute(int app_id, const ctx_t& app, std::shared_ptr launch_session) { - if (_app_id == util::from_view(input_only_app_id)) { + if (_app_id == input_only_app_id) { terminate(); std::this_thread::sleep_for(1s); } else { @@ -933,7 +934,7 @@ namespace proc { if (config::input.enable_input_only_mode) { proc::ctx_t ctx; // ctx.uuid = ""; // We're not using uuid for this special entry - ctx.name = "Input Only"; + ctx.name = "Remote Input"; ctx.image_path = parse_env_val(this_env, "input_only.png"); ctx.virtual_display = false; ctx.scale_factor = 100; @@ -957,7 +958,8 @@ namespace proc { } ids.insert(ctx.id); - input_only_app_id = ctx.id; + input_only_app_id_str = ctx.id; + input_only_app_id = util::from_view(ctx.id); apps.emplace_back(std::move(ctx)); } diff --git a/src/process.h b/src/process.h index 318e2660..a3cae6e7 100644 --- a/src/process.h +++ b/src/process.h @@ -182,5 +182,6 @@ namespace proc { terminate_process_group(boost::process::v1::child &proc, boost::process::v1::group &group, std::chrono::seconds exit_timeout); extern proc_t proc; - extern std::string input_only_app_id; + extern int input_only_app_id; + extern std::string input_only_app_id_str; } // namespace proc diff --git a/src_assets/common/assets/input_only.png b/src_assets/common/assets/input_only.png index a0f53ed2..8703c822 100644 Binary files a/src_assets/common/assets/input_only.png and b/src_assets/common/assets/input_only.png differ