diff --git a/client/X11/xfreerdp.c b/client/X11/xfreerdp.c index 16be086b4..6c63dcc6f 100644 --- a/client/X11/xfreerdp.c +++ b/client/X11/xfreerdp.c @@ -275,7 +275,7 @@ void xf_pointer_new(rdpUpdate* update, POINTER_NEW_UPDATE* pointer_new) if (pointer_new->xorBpp > 24) { - printf("xorBpp:%d\n", pointer_new->xorBpp); + freerdp_image_swap_color_order((uint8*) ci.pixels, ci.width, ci.height); } cursor = XcursorImageLoadCursor(xfi->display, &ci); diff --git a/include/freerdp/common/color.h b/include/freerdp/common/color.h index 8e199d5a5..3ffd74822 100644 --- a/include/freerdp/common/color.h +++ b/include/freerdp/common/color.h @@ -243,6 +243,7 @@ FREERDP_API uint8* freerdp_image_invert(uint8* srcData, uint8* dstData, int widt FREERDP_API uint8* freerdp_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width, int height, int bpp, HCLRCONV clrconv); FREERDP_API uint8* freerdp_mono_image_convert(uint8* srcData, int width, int height, int srcBpp, int dstBpp, uint32 bgcolor, uint32 fgcolor, HCLRCONV clrconv); FREERDP_API void freerdp_alpha_cursor_convert(uint8* alphaData, uint8* xorMask, uint8* andMask, int width, int height, int bpp, HCLRCONV clrconv); +FREERDP_API void freerdp_image_swap_color_order(uint8* data, int width, int height); #ifdef __cplusplus } diff --git a/libfreerdp-common/color.c b/libfreerdp-common/color.c index 540b2fe78..6c5280b39 100644 --- a/libfreerdp-common/color.c +++ b/libfreerdp-common/color.c @@ -862,10 +862,10 @@ void freerdp_alpha_cursor_convert(uint8* alphaData, uint8* xorMask, uint8* andMa { /* use pattern (not solid black) for xor area */ xpixel = (i & 1) == (j & 1); - xpixel = xpixel ? 0xffffff : 0; - xpixel |= 0xff000000; + xpixel = xpixel ? 0xFFFFFF : 0; + xpixel |= 0xFF000000; } - else if (xpixel == 0xff000000) + else if (xpixel == 0xFF000000) { xpixel = 0; } @@ -876,3 +876,21 @@ void freerdp_alpha_cursor_convert(uint8* alphaData, uint8* xorMask, uint8* andMa } } +void freerdp_image_swap_color_order(uint8* data, int width, int height) +{ + int x, y; + uint32* pixel; + uint8 a, r, g, b; + + pixel = (uint32*) data; + + for (y = 0; y < height; y++) + { + for (x = 0; x < width; x++) + { + GetARGB32(a, r, g, b, *pixel); + *pixel = ABGR32(a, r, g, b); + pixel++; + } + } +} diff --git a/libfreerdp-core/capabilities.c b/libfreerdp-core/capabilities.c index 466a321c5..43430cd6f 100644 --- a/libfreerdp-core/capabilities.c +++ b/libfreerdp-core/capabilities.c @@ -506,7 +506,11 @@ void rdp_write_pointer_capability_set(STREAM* s, rdpSettings* settings) stream_write_uint16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */ stream_write_uint16(s, settings->pointer_cache_size); /* colorPointerCacheSize (2 bytes) */ - stream_write_uint16(s, settings->pointer_cache_size); /* pointerCacheSize (2 bytes) */ + + if (settings->large_pointer) + { + stream_write_uint16(s, settings->pointer_cache_size); /* pointerCacheSize (2 bytes) */ + } rdp_capability_set_finish(s, header, CAPSET_TYPE_POINTER); } @@ -1877,6 +1881,12 @@ void rdp_write_confirm_active(STREAM* s, rdpSettings* settings) rdp_write_offscreen_bitmap_cache_capability_set(s, settings); } + if (settings->large_pointer) + { + numberCapabilities++; + rdp_write_large_pointer_capability_set(s, settings); + } + if (settings->remote_app) { numberCapabilities += 2;