Bug 547989 - [Win32] Owner-drawn table ignores set background color for sorting column
Summary: [Win32] Owner-drawn table ignores set background color for sorting column
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.12   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 536621
Blocks:
  Show dependency tree
 
Reported: 2019-06-06 06:33 EDT by Thomas Singer CLA
Modified: 2020-05-28 18:36 EDT (History)
7 users (show)

See Also:


Attachments
Snippet to reproduce (2.31 KB, text/plain)
2019-06-06 06:33 EDT, Thomas Singer CLA
no flags Details
Screenshot on Windows 10 (28.20 KB, image/png)
2019-06-06 06:35 EDT, Thomas Singer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Singer CLA 2019-06-06 06:33:16 EDT
Please run attached snippet on Windows.

Expected: all background should be black.

What happens: the color of the sort column is white.

This is a regression of bug 536621.
Comment 1 Thomas Singer CLA 2019-06-06 06:33:58 EDT
Created attachment 278831 [details]
Snippet to reproduce
Comment 2 Thomas Singer CLA 2019-06-06 06:35:01 EDT
Created attachment 278832 [details]
Screenshot on Windows 10
Comment 3 Nikita Nemkin CLA 2019-06-06 07:40:23 EDT
I'm on it.
Comment 4 Thomas Singer CLA 2019-07-01 05:02:18 EDT
Nikita, did you solved the problem already?
Comment 5 Nikita Nemkin CLA 2019-07-01 09:57:50 EDT
(In reply to Thomas Singer from comment #4)
> Nikita, did you solved the problem already?

Sorry, I haven't yet.
Comment 6 Niraj Modi CLA 2019-08-14 04:39:58 EDT
Ping!
Comment 7 Niraj Modi CLA 2019-09-03 06:56:26 EDT
Moving to 4.14
Comment 8 Niraj Modi CLA 2019-09-11 05:17:46 EDT
Hi Nikita,
Are you planning to work on this in 4.14 ?
Comment 9 Niraj Modi CLA 2019-11-27 03:52:09 EST
(In reply to Niraj Modi from comment #8)
> Hi Nikita,
> Are you planning to work on this in 4.14 ?

Resetting the target milestone for now, re-target as per your plan.
Comment 10 Lars Vogel CLA 2020-05-27 08:53:21 EDT
Maybe a similar issue as Bug 563475?
Comment 11 Alexandr Miloslavskiy CLA 2020-05-27 18:12:48 EDT
Yes, both this bug and Bug 563475 seem to be due to Bug 536621. I'm currently investigating.
Comment 12 Alexandr Miloslavskiy CLA 2020-05-28 18:36:22 EDT
So far, these are points from my research:

* This Bug 547989 appears since Bug 536621 change in `Table.CDDS_SUBITEMPREPAINT`
  Before:
     if (isWindowEnabled || hasCustomBackground()) {
       if (clrTextBk != -1 || hasCustomBackground())
  Equivalent to:
     if ((enabled && clrTextBk != -1) || hasCustomBackground())
  After:
     if ((enabled && clrTextBk != -1) || (!enabled && hasCustomBackground()))

* Reverting this change fixes this bug, but introduces another problem:
  1) Run ControlExample
  2) Go to 'Table' page.
  3) Enable 'Other' options:
     Header Visible
     Sort Indicator
  4) Set 'Background Color' to black
     Table now has a custom background.
     Sort column should have distinct background.
  5) Set 'Item Background Color'
     After repainting, Sort column no longer has distinct background.

* This Bug 547989 is related to yet another problem
  1) `Table.WM_SETREDRAW` removes `CLR_NONE`
  2) `TableColumn.setSortDirection()` doesn't see `CLR_NONE` and sets
     `LVM_SETSELECTEDCOLUMN`.
  3) Since Bug 536621, condition in `Table.CDDS_SUBITEMPREPAINT` is always
     false, and the workaround that fixes background color for selected
     column is not invoked, therefore resulting in wrong background.