Bug 578025

Summary: SWT.Skin event sent in wrong order (child before parent)
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: ts-swt
Version: 4.22   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189232
Whiteboard:
Attachments:
Description Flags
Snippet to reproduce
none
Screenshot on Windows 10 none

Description Thomas Singer CLA 2022-01-03 08:20:20 EST
Please run the attached snippet. It set's the shell colors to gray/yellow and all other controls inherit that. But the Label shows the wrong (initial) colors.
Comment 1 Thomas Singer CLA 2022-01-03 08:20:48 EST
Created attachment 287767 [details]
Snippet to reproduce
Comment 2 Thomas Singer CLA 2022-01-03 08:23:28 EST
Created attachment 287768 [details]
Screenshot on Windows 10

The logged order of the SWT.Skin events is

class org.eclipse.swt.widgets.Shell
class org.eclipse.swt.widgets.Composite
class org.eclipse.swt.widgets.Label
class org.eclipse.swt.widgets.Composite

The events are sent simply in the order in which the widgets were created. Invoking

  newParent.reskin(SWT.ALL);

after setting the new parent does not change it.
Comment 3 Eclipse Genie CLA 2022-01-03 08:32:10 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189232
Comment 4 Thomas Singer CLA 2022-01-03 08:33:15 EST
I'm not sure whether

  display.asyncExec(() -> newParent.reskin(SWT.ALL));

is the right choice to fix it, or the sent patch (it's only for Windows and meant for discussing base).