Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1357558

Summary: Desktop repainting with 8-bit colours on remote desktop via freerdp on x86_64
Product: Red Hat Enterprise Linux 7 Reporter: Tomas Hudziec <thudziec>
Component: freerdpAssignee: Ondrej Holy <oholy>
Status: CLOSED WONTFIX QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: tpelka
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-19 12:53:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1291254    
Bug Blocks:    
Attachments:
Description Flags
video of desktop repainting when moving window none

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

Filed from caserun https://tcms.engineering.redhat.com/case/531599/?from_plan=20833

Version-Release number of selected component (if applicable):
freerdp-1.0.2-10.el7.x86_64

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:
https://bugzilla.redhat.com/show_bug.cgi?id=1291254#c11

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...