From f04bb6c53dc5193b35652cb58f1db0732e494fbb Mon Sep 17 00:00:00 2001 From: Norbert Federa Date: Thu, 11 Jun 2015 18:40:41 +0200 Subject: [PATCH] xfreerdp: xfc->palette wasn't updated with /gdi:sw When using software gdi (/gdi:sw) the rdp update PDU callback gdi_palette_update() is used which writes the new colors to the rdpContext's gdi->palette buffer. The X11 functions however access xfc->palette which gets only updated by xf_gdi_palette_update() which is the callback if /gdi:hw is used. This commit changes xfc->palette to a pointer which points to xfc's private buffer with /gdi:hw or to the gdi->palette if software gdi is used. --- client/X11/xf_client.c | 2 ++ client/X11/xfreerdp.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index 04cabb0c5..39f25f1f7 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -1093,9 +1093,11 @@ BOOL xf_post_connect(freerdp* instance) gdi = context->gdi; xfc->primary_buffer = gdi->primary_buffer; + xfc->palette = gdi->palette; } else { + xfc->palette = xfc->palette_hwgdi; xfc->srcBpp = settings->ColorDepth; xf_gdi_register_update_callbacks(update); } diff --git a/client/X11/xfreerdp.h b/client/X11/xfreerdp.h index f6461a638..5e1bdfab1 100644 --- a/client/X11/xfreerdp.h +++ b/client/X11/xfreerdp.h @@ -127,7 +127,8 @@ struct xf_context HANDLE mutex; BOOL UseXThreads; BOOL cursorHidden; - BYTE palette[256 * 4]; + BYTE* palette; + BYTE palette_hwgdi[256 * 4]; HGDI_DC hdc; UINT32 bitmap_size;