From ceb015a6bbc945578fecf274f04eafd9db96af20 Mon Sep 17 00:00:00 2001 From: Norbert Federa Date: Wed, 26 Feb 2020 12:24:21 +0100 Subject: [PATCH] egfx: the gfx reset grahics pdu is optional Since the EGFX Reset Graphics PDU seems to be optional, the graphicsReset variable (which is updated in that PDU's handler) should be removed from the rdp_gdi struct with the next change in public headers (as in freerdp v3). There are still some clients that expect and check it and therefore we keep it for now, initialized with TRUE. sdas --- client/X11/xf_gfx.c | 3 --- include/freerdp/gdi/gdi.h | 2 +- libfreerdp/gdi/gfx.c | 13 +++++++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/client/X11/xf_gfx.c b/client/X11/xf_gfx.c index 9e94a88ee..5d0c0cbcd 100644 --- a/client/X11/xf_gfx.c +++ b/client/X11/xf_gfx.c @@ -121,9 +121,6 @@ static UINT xf_UpdateSurfaces(RdpgfxClientContext* context) if (!gdi) return status; - if (!gdi->graphicsReset) - return status; - if (gdi->suppressOutput) return CHANNEL_RC_OK; diff --git a/include/freerdp/gdi/gdi.h b/include/freerdp/gdi/gdi.h index 77dfe318c..ddb310b39 100644 --- a/include/freerdp/gdi/gdi.h +++ b/include/freerdp/gdi/gdi.h @@ -517,7 +517,7 @@ struct rdp_gdi void (*free)(void*); BOOL inGfxFrame; - BOOL graphicsReset; + BOOL graphicsReset; /* deprecated, remove with FreeRDP v3 */ BOOL suppressOutput; UINT16 outputSurfaceId; RdpgfxClientContext* gfx; diff --git a/libfreerdp/gdi/gfx.c b/libfreerdp/gdi/gfx.c index 479d4095a..a564e9529 100644 --- a/libfreerdp/gdi/gfx.c +++ b/libfreerdp/gdi/gfx.c @@ -92,7 +92,6 @@ static UINT gdi_ResetGraphics(RdpgfxClientContext* context, gdi->height)) goto fail; - gdi->graphicsReset = TRUE; rc = CHANNEL_RC_OK; fail: LeaveCriticalSection(&context->mux); @@ -167,9 +166,6 @@ static UINT gdi_UpdateSurfaces(RdpgfxClientContext* context) UINT16* pSurfaceIds = NULL; rdpGdi* gdi = (rdpGdi*)context->custom; - if (!gdi->graphicsReset) - return CHANNEL_RC_OK; - EnterCriticalSection(&context->mux); context->GetSurfaceIds(context, &pSurfaceIds, &count); status = CHANNEL_RC_OK; @@ -1474,6 +1470,15 @@ BOOL gdi_graphics_pipeline_init_ex(rdpGdi* gdi, RdpgfxClientContext* gfx, gfx->UpdateSurfaceArea = update; InitializeCriticalSection(&gfx->mux); PROFILER_CREATE(gfx->SurfaceProfiler, "GFX-PROFILER"); + + /** + * gdi->graphicsReset will be removed in FreeRDP v3 from public headers, + * since the EGFX Reset Graphics PDU seems to be optional. + * There are still some clients that expect and check it and therefore + * we simply initialize it with TRUE here for now. + */ + gdi->graphicsReset = TRUE; + return TRUE; }