[client,common] change /dynamic-resizing to BOOL option

Allows to use +-/ prefixes to enable/disable the option. Brought up on
matrix channel for uses with RDP files that enable the option. Now it
can be disabled by adding -dynamic-resolution on command line.
This commit is contained in:
Armin Novak 2024-09-11 11:01:49 +02:00
parent b66486ed23
commit 17c209c0f9
No known key found for this signature in database
GPG Key ID: 2CF4A2D2D3D72105
2 changed files with 6 additions and 4 deletions

View File

@ -2753,15 +2753,17 @@ static int parse_dynamic_resolution_options(rdpSettings* settings,
WINPR_ASSERT(settings);
WINPR_ASSERT(arg);
if (freerdp_settings_get_bool(settings, FreeRDP_SmartSizing))
const BOOL val = arg->Value != 0;
if (val && freerdp_settings_get_bool(settings, FreeRDP_SmartSizing))
{
WLog_ERR(TAG, "Smart sizing and dynamic resolution are mutually exclusive options");
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
}
if (!freerdp_settings_set_bool(settings, FreeRDP_SupportDisplayControl, TRUE))
if (!freerdp_settings_set_bool(settings, FreeRDP_SupportDisplayControl, val))
return COMMAND_LINE_ERROR;
if (!freerdp_settings_set_bool(settings, FreeRDP_DynamicResolutionUpdate, TRUE))
if (!freerdp_settings_set_bool(settings, FreeRDP_DynamicResolutionUpdate, val))
return COMMAND_LINE_ERROR;
return 0;

View File

@ -151,7 +151,7 @@ static const COMMAND_LINE_ARGUMENT_A global_cmd_args[] = {
NULL, "record or replay dump" },
{ "dvc", COMMAND_LINE_VALUE_REQUIRED, "<channel>[,<options>]", NULL, NULL, -1, NULL,
"Dynamic virtual channel" },
{ "dynamic-resolution", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL,
{ "dynamic-resolution", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL,
"Send resolution updates when the window is resized" },
{ "echo", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, "echo", "Echo channel" },
{ "encryption", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL,