Merge pull request #5761 from akallabeth/rdp_file_add_option

Added RDP file option 'desktop size id:i:' support.
This commit is contained in:
Martin Fleisz 2019-11-29 09:55:48 +01:00 committed by GitHub
commit 35691c155b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1218,6 +1218,45 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings*
return FALSE;
}
if (~file->DesktopSizeId)
{
switch (file->DesktopSizeId)
{
case 0:
if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, 640))
return FALSE;
if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopHeight, 480))
return FALSE;
break;
case 1:
if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, 800))
return FALSE;
if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopHeight, 600))
return FALSE;
break;
case 2:
if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, 1024))
return FALSE;
if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopHeight, 768))
return FALSE;
break;
case 3:
if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, 1280))
return FALSE;
if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopHeight, 1024))
return FALSE;
break;
case 4:
if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, 1600))
return FALSE;
if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopHeight, 1200))
return FALSE;
break;
default:
WLog_WARN(TAG, "Unsupported 'desktop size id' value %" PRIu32, file->DesktopSizeId);
break;
}
}
if (~file->DesktopWidth)
{
if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, file->DesktopWidth))