fixed hdc initialization into wf_begin_paint so the region invalidation into wf_end_p...
authorcedrozor <cedrozor@gmail.com>
Fri, 27 Oct 2017 12:30:00 +0000 (14:30 +0200)
committercedrozor <cedrozor@gmail.com>
Fri, 27 Oct 2017 12:30:00 +0000 (14:30 +0200)
the objective is that only the updated region(s) are refreshed instead of the whole screen
it's not much a problem for normal FreeRDP usage but becomes a serious issue if the display is processed, forwarded and rendered remotely, as done by web gateways such as Guacamole, FreeRDP-WebConnect and Myrtille (I'm the author of the latter)

client/Windows/wf_client.c

index 5e0478b..cb6df51 100644 (file)
@@ -119,10 +119,10 @@ static BOOL wf_begin_paint(rdpContext* context)
 {
        HGDI_DC hdc;
 
-       if (!context || !context->gdi || !context->gdi->hdc)
+       if (!context || !context->gdi || !context->gdi->primary || !context->gdi->primary->hdc)
                return FALSE;
 
-       hdc = context->gdi->hdc;
+       hdc = context->gdi->primary->hdc;
 
        if (!hdc || !hdc->hwnd || !hdc->hwnd->invalid)
                return FALSE;