From dcdf1d7a5bcf62d8b0d46fba3332000bad991ab9 Mon Sep 17 00:00:00 2001 From: David Sundstrom Date: Mon, 9 Jan 2012 15:39:19 -0600 Subject: [PATCH 1/2] Invert rectangle colors when X server uses inverted colors --- client/X11/xf_gdi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/X11/xf_gdi.c b/client/X11/xf_gdi.c index f1760f2c9..3441b6589 100644 --- a/client/X11/xf_gdi.c +++ b/client/X11/xf_gdi.c @@ -432,7 +432,9 @@ void xf_gdi_opaque_rect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect) uint32 color; xfInfo* xfi = ((xfContext*) context)->xfi; - color = freerdp_color_convert_var_rgb(opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv); + color = (xfi->clrconv->invert)? + freerdp_color_convert_var_bgr(opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv): + freerdp_color_convert_var_rgb(opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv); XSetFunction(xfi->display, xfi->gc, GXcopy); XSetFillStyle(xfi->display, xfi->gc, FillSolid); @@ -461,7 +463,9 @@ void xf_gdi_multi_opaque_rect(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* mult DELTA_RECT* rectangle; xfInfo* xfi = ((xfContext*) context)->xfi; - color = freerdp_color_convert_var_rgb(multi_opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv); + color = (xfi->clrconv->invert)? + freerdp_color_convert_var_bgr(multi_opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv): + freerdp_color_convert_var_rgb(multi_opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv); XSetFunction(xfi->display, xfi->gc, GXcopy); XSetFillStyle(xfi->display, xfi->gc, FillSolid); From 4975267c053f38059aff626e5234da06d13b052c Mon Sep 17 00:00:00 2001 From: David Sundstrom Date: Mon, 9 Jan 2012 16:08:57 -0600 Subject: [PATCH 2/2] Invert colors went X server uses BGR colormap --- client/X11/xf_graphics.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/X11/xf_graphics.c b/client/X11/xf_graphics.c index 276c65c92..ed5f9bc25 100644 --- a/client/X11/xf_graphics.c +++ b/client/X11/xf_graphics.c @@ -243,8 +243,13 @@ void xf_Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height { xfInfo* xfi = ((xfContext*) context)->xfi; - bgcolor = freerdp_color_convert_var_rgb(bgcolor, xfi->srcBpp, 32, xfi->clrconv); - fgcolor = freerdp_color_convert_var_rgb(fgcolor, xfi->srcBpp, 32, xfi->clrconv); + bgcolor = (xfi->clrconv->invert)? + freerdp_color_convert_var_bgr(bgcolor, xfi->srcBpp, 32, xfi->clrconv): + freerdp_color_convert_var_rgb(bgcolor, xfi->srcBpp, 32, xfi->clrconv); + + fgcolor = (xfi->clrconv->invert)? + freerdp_color_convert_var_bgr(fgcolor, xfi->srcBpp, 32, xfi->clrconv): + freerdp_color_convert_var_rgb(fgcolor, xfi->srcBpp, 32, xfi->clrconv); XSetFunction(xfi->display, xfi->gc, GXcopy); XSetFillStyle(xfi->display, xfi->gc, FillSolid);