mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Removed unnecessary allocation
This commit is contained in:
@@ -260,7 +260,6 @@ static void wf_sizing(wfContext* wfc, WPARAM wParam, LPARAM lParam)
|
|||||||
static void wf_send_resize(wfContext* wfc)
|
static void wf_send_resize(wfContext* wfc)
|
||||||
{
|
{
|
||||||
RECT windowRect;
|
RECT windowRect;
|
||||||
DISPLAY_CONTROL_MONITOR_LAYOUT* layout;
|
|
||||||
int targetWidth = wfc->client_width;
|
int targetWidth = wfc->client_width;
|
||||||
int targetHeight = wfc->client_height;
|
int targetHeight = wfc->client_height;
|
||||||
rdpSettings* settings = wfc->context.settings;
|
rdpSettings* settings = wfc->context.settings;
|
||||||
@@ -278,22 +277,23 @@ static void wf_send_resize(wfContext* wfc)
|
|||||||
if (settings->SmartSizingWidth != targetWidth ||
|
if (settings->SmartSizingWidth != targetWidth ||
|
||||||
settings->SmartSizingHeight != targetHeight)
|
settings->SmartSizingHeight != targetHeight)
|
||||||
{
|
{
|
||||||
layout = calloc(1, sizeof(DISPLAY_CONTROL_MONITOR_LAYOUT));
|
DISPLAY_CONTROL_MONITOR_LAYOUT layout = { 0 };
|
||||||
layout->Flags = DISPLAY_CONTROL_MONITOR_PRIMARY;
|
|
||||||
layout->Top = layout->Left = 0;
|
layout.Flags = DISPLAY_CONTROL_MONITOR_PRIMARY;
|
||||||
layout->Width = targetWidth;
|
layout.Top = layout.Left = 0;
|
||||||
layout->Height = targetHeight;
|
layout.Width = targetWidth;
|
||||||
layout->Orientation = settings->DesktopOrientation;
|
layout.Height = targetHeight;
|
||||||
layout->DesktopScaleFactor = settings->DesktopScaleFactor;
|
layout.Orientation = settings->DesktopOrientation;
|
||||||
layout->DeviceScaleFactor = settings->DeviceScaleFactor;
|
layout.DesktopScaleFactor = settings->DesktopScaleFactor;
|
||||||
layout->PhysicalWidth = targetWidth;
|
layout.DeviceScaleFactor = settings->DeviceScaleFactor;
|
||||||
layout->PhysicalHeight = targetHeight;
|
layout.PhysicalWidth = targetWidth;
|
||||||
|
layout.PhysicalHeight = targetHeight;
|
||||||
|
|
||||||
if (IFCALLRESULT(CHANNEL_RC_OK, wfc->disp->SendMonitorLayout, wfc->disp, 1,
|
if (IFCALLRESULT(CHANNEL_RC_OK, wfc->disp->SendMonitorLayout, wfc->disp, 1,
|
||||||
layout) != CHANNEL_RC_OK)
|
&layout) != CHANNEL_RC_OK)
|
||||||
{
|
{
|
||||||
WLog_ERR("", "SendMonitorLayout failed.");
|
WLog_ERR("", "SendMonitorLayout failed.");
|
||||||
}
|
}
|
||||||
free(layout);
|
|
||||||
settings->SmartSizingWidth = targetWidth;
|
settings->SmartSizingWidth = targetWidth;
|
||||||
settings->SmartSizingHeight = targetHeight;
|
settings->SmartSizingHeight = targetHeight;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user