Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1357558 - Desktop repainting with 8-bit colours on remote desktop via freerdp on x86_64
Summary: Desktop repainting with 8-bit colours on remote desktop via freerdp on x86_64
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: freerdp
Version: 7.3
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Ondrej Holy
QA Contact: Desktop QE
Depends On: 1291254
TreeView+ depends on / blocked
Reported: 2016-07-18 13:47 UTC by Tomas Hudziec
Modified: 2018-11-19 12:53 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-11-19 12:53:45 UTC
Target Upstream Version:

Attachments (Terms of Use)
video of desktop repainting when moving window (deleted)
2016-07-18 13:47 UTC, Tomas Hudziec
no flags Details

Description Tomas Hudziec 2016-07-18 13:47:28 UTC
Created attachment 1181105 [details]
video of desktop repainting when moving window

Filed from caserun

Version-Release number of selected component (if applicable):

Steps to Reproduce: 

Have freerdp installed
Launch the linux terminal
Type the $ xfreerdp -a 8 $WindowsIP

Actual results: 
Desktop is being repainted when moving window.

Expected results:
Verify that remote windows window is displayed in coresponding color depth.

Comment 2 Ondrej Holy 2016-07-20 09:02:49 UTC
Color profiles are swapped  when converting from 8bpp to 32bpp, which causes those glitches when moving window...

diff --git a/libfreerdp-codec/color.c b/libfreerdp-codec/color.c
index ff3bacb..23509bd 100644
--- a/libfreerdp-codec/color.c
+++ b/libfreerdp-codec/color.c
@@ -423,3 +423,3 @@ uint8* freerdp_image_convert_8bpp(uint8* srcData, uint8* dstData, int width, int
                        blue = clrconv->palette->entries[pixel].blue;
-                       pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue);
+                       pixel = (clrconv->invert) ? BGR32(red, green, blue) : RGB32(red, green, blue);
                        *dst32 = pixel;

The glitches should be fixed with the first diff applied, however the colors are still inverted. Wrong color profile is probably used when updating palette:

diff --git a/libfreerdp-core/update.c b/libfreerdp-core/update.c
index c828b22..06fa4e3 100644
--- a/libfreerdp-core/update.c
+++ b/libfreerdp-core/update.c
@@ -128,5 +128,5 @@ void update_read_palette(rdpUpdate* update, STREAM* s, PALETTE_UPDATE* palette_u
-               stream_read_uint8(s, entry->blue);
-               stream_read_uint8(s, entry->green);
                stream_read_uint8(s, entry->red);
+               stream_read_uint8(s, entry->green);
+               stream_read_uint8(s, entry->blue);

However still some icons seem to have corrupted colors and I am not really sure why. 

The color handling is broken in some cases in freerdp-1.0 (see also Bug 1308810). It seems that freerdp master has some of those problems already fixed, however backporting such fixes would be pretty complicated, because (not only) color handling was refactored several times and another overhaul is almost done. 

It would require a lot of effort to fix it properly and I afraid that the bug doesn't seem to have enough priority to justify the invested effort (same as Bug 1308810). I think that the only reasonable solution is to make a rebase once freerdp-2.0 is released (Bug 1291254). 

It is too late for rhel-7.3 anyway, let's reconsider this for rhel-7.4.

Comment 5 Ondrej Holy 2017-10-05 10:31:28 UTC
Just a few more notes:
There are more color glitches with 8bpp if X server depth is 16.
Also cursor colors are wrong in some cases for 8bpp.

Comment 6 Ondrej Holy 2017-10-05 10:37:21 UTC
Seems fixed upstream.

Comment 7 Ondrej Holy 2018-05-31 12:08:48 UTC
Let's postpone this to RHEL-7.7. See:

Comment 8 Tomas Hudziec 2018-07-04 12:15:17 UTC
Still reproducible on RHEL 7.6 with freerdp-1.0.2-15.el7.x86_64.

Comment 9 Ondrej Holy 2018-11-19 12:53:45 UTC
I don't really plan to fix this for freerdp 1.0. We are still postponing this together with Bug 1291254. So let's close this finally as WONTFIX. This will be simply fixed once we rebase. I don't really think that somebody uses 8-bit color depth anyway...

Note You need to log in before you can comment on or make changes to this bug.