Bug 576690

Summary: [Tree] PaintItem does not receive HOT flag if unset in EraseItem
Product: [Eclipse Project] Platform Reporter: Thomas Singer <ts-swt>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: alexandr.miloslavskiy, rolf.theunissen, ts-swt
Version: 4.22   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
Snippet to reproduce
none
Screenshot on Windows 10 none

Description Thomas Singer CLA 2021-10-18 04:35:25 EDT
Please launch the attached snippet. It should show a tree with white background and dark foreground. Selected rows should have a yellow background and hovered cells a gray background with red foreground. To avoid the system to draw the hot-effect we have to unset the SWT.HOT flat in the EraseItem listener. Unfortunately, this also prevents the PaintItem from receiving this flag.
Comment 1 Thomas Singer CLA 2021-10-18 04:35:45 EDT
Created attachment 287327 [details]
Snippet to reproduce
Comment 2 Thomas Singer CLA 2021-10-18 04:36:52 EDT
Created attachment 287328 [details]
Screenshot on Windows 10
Comment 3 Rolf Theunissen CLA 2021-10-18 05:49:56 EDT
The hot flag of the item is removed in CDDS_ITEMPREPAINT, when ignoreDrawHot is true. 

Line 1160:
  if (explorerTheme) {
    if (selected || (hot && ignoreDrawHot)) nmcd.uItemState &= ~OS.CDIS_HOT;
    OS.MoveMemory (lParam, nmcd, NMTVCUSTOMDRAW.sizeof);
  }

When theses lines are commented out, the snipped seems to work. Though, don't have sufficient knowledge about the win32/swt API to fix this issue.