From fc992ee74092287c2482d1de20047cecbd37d1b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A5l=20H=C3=A5land?= Date: Thu, 28 Nov 2019 18:59:15 +0100 Subject: [PATCH] SmartSizingWidth and SmartSizingHeight in RDP file: Adding this option to use the DesktopHeight and DesktopWidth as parameters for the SmartSizingWidth and SmartSizingHeight, as there are no options for that in standard RDP files. Equivalent of doing /smart-sizing:WxH --- client/common/file.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/client/common/file.c b/client/common/file.c index 09cd175..3b7148f 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -1340,6 +1340,25 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (!freerdp_settings_set_bool(settings, FreeRDP_SmartSizing, (file->SmartSizing == 1) ? TRUE : FALSE)) return FALSE; + /** + * SmartSizingWidth and SmartSizingHeight: + * + * Adding this option to use the DesktopHeight and DesktopWidth as + * parameters for the SmartSizingWidth and SmartSizingHeight, as there + * are no options for that in standard RDP files. + * + * Equivalent of doing /smart-sizing:WxH + */ + if (((~(file->DesktopWidth) && ~(file->DesktopHeight)) || ~(file->DesktopSizeId)) && + (file->SmartSizing == 1)) + { + if (!freerdp_settings_set_uint32(settings, FreeRDP_SmartSizingWidth, + file->DesktopWidth)) + return FALSE; + if (!freerdp_settings_set_uint32(settings, FreeRDP_SmartSizingHeight, + file->DesktopHeight)) + return FALSE; + } } if (~((size_t)file->LoadBalanceInfo)) -- 2.7.4