libfreerdp-gdi: handle egfx desktop resize

This commit is contained in:
Marc-André Moreau 2014-09-25 22:08:10 -04:00
parent ca1cec64d8
commit 9daa8bd36f
3 changed files with 24 additions and 3 deletions

View File

@ -102,6 +102,9 @@ int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize,
seqNumber = pSrcData[1]; seqNumber = pSrcData[1];
offset += 2; offset += 2;
if (!clear->seqNumber && seqNumber)
clear->seqNumber = seqNumber;
if (seqNumber != clear->seqNumber) if (seqNumber != clear->seqNumber)
return -1005; return -1005;

View File

@ -668,8 +668,10 @@ BOOL rdp_recv_monitor_layout_pdu(rdpRdp* rdp, wStream* s)
if (Stream_GetRemainingLength(s) < (monitorCount * 20)) if (Stream_GetRemainingLength(s) < (monitorCount * 20))
return FALSE; return FALSE;
monitorDefArray = (MONITOR_DEF*) malloc(sizeof(MONITOR_DEF) * monitorCount); monitorDefArray = (MONITOR_DEF*) calloc(monitorCount, sizeof(MONITOR_DEF));
ZeroMemory(monitorDefArray, sizeof(MONITOR_DEF) * monitorCount);
if (!monitorDefArray)
return FALSE;
for (index = 0; index < monitorCount; index++) for (index = 0; index < monitorCount; index++)
{ {
@ -682,6 +684,7 @@ BOOL rdp_recv_monitor_layout_pdu(rdpRdp* rdp, wStream* s)
} }
free(monitorDefArray); free(monitorDefArray);
return TRUE; return TRUE;
} }

View File

@ -29,12 +29,27 @@
int gdi_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) int gdi_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics)
{ {
UINT32 DesktopWidth;
UINT32 DesktopHeight;
rdpGdi* gdi = (rdpGdi*) context->custom; rdpGdi* gdi = (rdpGdi*) context->custom;
rdpUpdate* update = gdi->context->update;
rdpSettings* settings = gdi->context->settings;
freerdp_client_codecs_reset(gdi->codecs, FREERDP_CODEC_ALL); DesktopWidth = resetGraphics->width;
DesktopHeight = resetGraphics->height;
region16_init(&(gdi->invalidRegion)); region16_init(&(gdi->invalidRegion));
if ((DesktopWidth != settings->DesktopWidth) ||
(DesktopHeight != settings->DesktopHeight))
{
settings->DesktopWidth = DesktopWidth;
settings->DesktopHeight = DesktopHeight;
if (update)
update->DesktopResize(gdi->context);
}
gdi->graphicsReset = TRUE; gdi->graphicsReset = TRUE;
return 1; return 1;