From 1b2f95dfde2d1590c851c207413bef1aad63e4f3 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 21 Mar 2024 09:22:29 +0100 Subject: [PATCH] [client,common] allow deactivating RAILS hidef mode --- client/common/cmdline.c | 28 ++++++++++++++++------------ client/common/cmdline.h | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 172836f93..209a911de 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -3582,18 +3582,18 @@ static int parse_app_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT_ struct app_map { const char* name; - FreeRDP_Settings_Keys_String id; + SSIZE_T id; int (*fkt)(rdpSettings* settings, const char* value); }; - const struct app_map amap[] = { - { "program:", FreeRDP_RemoteApplicationProgram, parse_app_option_program }, - { "workdir:", FreeRDP_RemoteApplicationWorkingDir, NULL }, - { "name:", FreeRDP_RemoteApplicationName, NULL }, - { "icon:", FreeRDP_RemoteApplicationIcon, NULL }, - { "cmd:", FreeRDP_RemoteApplicationCmdLine, NULL }, - { "file:", FreeRDP_RemoteApplicationFile, NULL }, - { "guid:", FreeRDP_RemoteApplicationGuid, NULL }, - }; + const struct app_map amap[] = { { "program:", FreeRDP_RemoteApplicationProgram, + parse_app_option_program }, + { "workdir:", FreeRDP_RemoteApplicationWorkingDir, NULL }, + { "name:", FreeRDP_RemoteApplicationName, NULL }, + { "icon:", FreeRDP_RemoteApplicationIcon, NULL }, + { "cmd:", FreeRDP_RemoteApplicationCmdLine, NULL }, + { "file:", FreeRDP_RemoteApplicationFile, NULL }, + { "guid:", FreeRDP_RemoteApplicationGuid, NULL }, + { "hidef:", FreeRDP_HiDefRemoteApp, NULL } }; for (size_t x = 0; x < count; x++) { BOOL handled = FALSE; @@ -3607,8 +3607,12 @@ static int parse_app_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT_ const char* xval = &val[strlen(cur->name)]; if (cur->fkt) rc = cur->fkt(settings, xval); - else if (!freerdp_settings_set_string(settings, cur->id, xval)) - rc = COMMAND_LINE_ERROR_MEMORY; + else + { + const char* name = freerdp_settings_get_name_for_key(cur->id); + if (!freerdp_settings_set_value_for_name(settings, name, xval)) + rc = COMMAND_LINE_ERROR_MEMORY; + } handled = TRUE; break; diff --git a/client/common/cmdline.h b/client/common/cmdline.h index 8186cc68f..3afddb1f0 100644 --- a/client/common/cmdline.h +++ b/client/common/cmdline.h @@ -34,7 +34,7 @@ static const COMMAND_LINE_ARGUMENT_A global_cmd_args[] = { "desktop composition" }, { "app", COMMAND_LINE_VALUE_REQUIRED, "program:[|<||alias>],cmd:,file:,guid:,icon:,name:<" - "name>,workdir:", + "name>,workdir:,hidef:[on|off]", NULL, NULL, -1, NULL, "Remote application program" }, #if defined(WITH_FREERDP_DEPRECATED_COMMANDLINE) { "app-cmd", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL,