Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 539660

Summary: [Cocoa][10.14] Shell background under macOS 10.14 (Mojave) is white instead of gray
Product: [Eclipse Project] Platform Reporter: Thomas Singer <eclipse>
Component: SWTAssignee: Lakshmi P Shanmugam <lshanmug>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse, konrad_w, lshanmug, p.belusky, peter, register.eclipse, shashwat.work
Version: 4.9   
Target Milestone: 4.10 M3   
Hardware: Macintosh   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/130748
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=b7f9ee185c5fda2bc82474b9f515146205a789bd
https://git.eclipse.org/r/130845
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a35cc4fcf86e4356dc9e591ed9718fe6cc911a9a
Whiteboard:
Bug Depends on:    
Bug Blocks: 538976    
Attachments:
Description Flags
Wrong background color in Eclipse Preferences in Mac OS 10.14 none

Description Thomas Singer CLA 2018-09-30 06:47:45 EDT
Please try a simple SWT snippet like

	public static void main(String[] args) {
		final Display display = new Display();

		final Shell shell = new Shell(display);

		createButton(shell, "Hello").setLocation(10, 10);

		final Composite composite = new Composite(shell, SWT.NONE);

		createButton(composite, "World").setLocation(10, 10);
		composite.setBounds(20, 50, 300, 200);

		shell.setSize(400, 300);
		shell.open();

		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}

		display.dispose();
	}

	public static Button createButton(Composite parent, String text) {
		final Button button = new Button(parent, SWT.PUSH);
		button.setText(text);
		button.setSize(button.computeSize(SWT.DEFAULT, SWT.DEFAULT));
		return button;
	}
on macOS 10.14 and earlier. On 10.14 the shell's background will be white instead of the usual gray from previous applications.
Comment 1 Konrad Windszus CLA 2018-10-09 04:52:55 EDT
Created attachment 276179 [details]
Wrong background color in Eclipse Preferences in Mac OS 10.14
Comment 2 Konrad Windszus CLA 2018-10-09 04:54:25 EDT
I do have a similar issue with wrong background colors in Mac OS 10.14 (Mojave). The nested containers have a grey background color instead of white. Please see the attached screenshot of the Eclipse Preference Page "General"
Comment 3 Lakshmi P Shanmugam CLA 2018-10-10 05:01:59 EDT
SWT uses NSColor.controlHighlightColor() as the default background color. This is returning white on macOS 10.14. I'm looking at changing this to NSColor.windowBackgroundColor() which returns gray.
The background color for Group widget also looks different, since it uses NSBox may be some change is required.
Comment 4 Lakshmi P Shanmugam CLA 2018-10-10 05:11:27 EDT
(In reply to Konrad Windszus from comment #2)
> The nested containers have a grey background color instead of
> white.

Why do you think the background should be white instead of gray? It is gray on older versions.
Comment 5 Konrad Windszus CLA 2018-10-10 05:13:23 EDT
Yes, sorry for the confusion here. I just checked other native apps (like Mail, Calendar) and there the background for preference pages is still grey. So it should also be grey in SWT.
Comment 6 Eclipse Genie CLA 2018-10-10 08:20:20 EDT
New Gerrit change created: https://git.eclipse.org/r/130748
Comment 8 Eclipse Genie CLA 2018-10-12 08:30:25 EDT
New Gerrit change created: https://git.eclipse.org/r/130845
Comment 10 Lakshmi P Shanmugam CLA 2018-11-13 01:01:31 EST
*** Bug 540670 has been marked as a duplicate of this bug. ***
Comment 11 Lakshmi P Shanmugam CLA 2018-11-21 03:27:54 EST
Verified with I20181119-2315.