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

Bug 570251

Summary: [Mac][BigSur] Content Assist icons not drawn correctly on BigSur
Product: [Eclipse Project] Platform Reporter: Matthias Becker <ma.becker>
Component: SWTAssignee: Lakshmi P Shanmugam <lshanmug>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: lshanmug, register.eclipse, s.zimmermann, sebastian.ratz, thomas.alexander.ritter, yannic.soethoff
Version: 4.18Flags: lshanmug: review+
Target Milestone: 4.20 RC1   
Hardware: PC   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/180642
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=f6c68495ee7b34a64b4f0ef8fca3364c076d4c7d
Whiteboard:
Bug Depends on:    
Bug Blocks: 569361    

Description Matthias Becker CLA 2021-01-11 08:48:45 EST
The content assist icon (the light bulb) on input fields e.g. in wizards are not drawn on macOS BigSur. They however appear once you manually resize the dialog with the mouse.

The strange thing is that I can also reproduce this partly on macOS Catalina (10.15.7). If running an Eclipse application in the normal way (simply starting the app) everything is fine (content assist icon is drawn). But when running an Eclipse out of another Eclipse (via Run as -> Eclipse Application) I see the same wrong behaviour as on BigSur (content assist icon is only drawn after resizing the dialog).

On macOS 10.15.7 you can reproduce this with the "New Java Class Wizard". This wizard has a content assist for the "package" field. The icon is shown once the cursor enters this field. 

Just download the 2020-12 version of the "Eclipse IDE for Eclipse Committers" package. Create a java project and create a class. You will see the lightbulb when the cursor is in the package field. Cancel the wizard.

New create a new run configuration for an "Eclipse application". Just take the defaults and hit "Run". In the newly starting Eclipse IDE do the same as above. You will see that the content assist icon is not immediately show once the cursor enters the package field. Now resize the wizard dialog and the content assist icon appears.

Does anybody have a clue what the difference in starting (the same IDE) on the same OS is here? 

I assume this is an issue in SWT.
Comment 1 Lakshmi P Shanmugam CLA 2021-01-11 10:08:03 EST
(In reply to Matthias Becker from comment #0)
> Does anybody have a clue what the difference in starting (the same IDE) on
> the same OS is here? 
> 
There is difference because Eclipse launcher is built with an older SDK (10.10). Please see explanation here - https://bugs.eclipse.org/bugs/show_bug.cgi?id=568749#c4
Comment 2 Matthias Becker CLA 2021-01-11 10:30:23 EST
(In reply to Lakshmi P Shanmugam from comment #1)
> There is difference because Eclipse launcher is built with an older SDK
> (10.10). Please see explanation here -
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=568749#c4

Thank you for this hint. Very interesting. 

Do you have an idea how to fix the "light bulb" issue?
Comment 3 Lakshmi P Shanmugam CLA 2021-01-15 07:16:05 EST
(In reply to Matthias Becker from comment #2)
> (In reply to Lakshmi P Shanmugam from comment #1)
> > There is difference because Eclipse launcher is built with an older SDK
> > (10.10). Please see explanation here -
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=568749#c4
> 
> Thank you for this hint. Very interesting. 
> 
> Do you have an idea how to fix the "light bulb" issue?

I didn't check the code, but cause could be similar to Bug 567132. Missing redraw calls, see https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/171371

Can you please point to the code where the light bulb is drawn?
Comment 4 Matthias Becker CLA 2021-01-15 07:46:59 EST
(In reply to Lakshmi P Shanmugam from comment #3)
> (In reply to Matthias Becker from comment #2)
> > (In reply to Lakshmi P Shanmugam from comment #1)
> > > There is difference because Eclipse launcher is built with an older SDK
> > > (10.10). Please see explanation here -
> > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=568749#c4
> > 
> > Thank you for this hint. Very interesting. 
> > 
> > Do you have an idea how to fix the "light bulb" issue?
> 
> I didn't check the code, but cause could be similar to Bug 567132. Missing
> redraw calls, see
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/171371
> 
> Can you please point to the code where the light bulb is drawn?

org.eclipse.jface.fieldassist.ControlDecoration is used for this.
Comment 5 Matthias Becker CLA 2021-02-23 05:26:32 EST
(In reply to Lakshmi P Shanmugam from comment #3)
> (In reply to Matthias Becker from comment #2)
> > (In reply to Lakshmi P Shanmugam from comment #1)
> > > There is difference because Eclipse launcher is built with an older SDK
> > > (10.10). Please see explanation here -
> > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=568749#c4
> > 
> > Thank you for this hint. Very interesting. 
> > 
> > Do you have an idea how to fix the "light bulb" issue?
> 
> I didn't check the code, but cause could be similar to Bug 567132. Missing
> redraw calls, see
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/171371
> 
> Can you please point to the code where the light bulb is drawn?

Hi Lakshmi,

any progress on this?
Comment 6 Lakshmi P Shanmugam CLA 2021-02-23 13:05:15 EST
(In reply to Matthias Becker from comment #5)
> (In reply to Lakshmi P Shanmugam from comment #3)
> > (In reply to Matthias Becker from comment #2)
> > > (In reply to Lakshmi P Shanmugam from comment #1)
> > > > There is difference because Eclipse launcher is built with an older SDK
> > > > (10.10). Please see explanation here -
> > > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=568749#c4
> > > 
> > > Thank you for this hint. Very interesting. 
> > > 
> > > Do you have an idea how to fix the "light bulb" issue?
> > 
> > I didn't check the code, but cause could be similar to Bug 567132. Missing
> > redraw calls, see
> > https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/171371
> > 
> > Can you please point to the code where the light bulb is drawn?
> 
> Hi Lakshmi,
> 
> any progress on this?

I looked at ControlDecoration.update(). There is a call to Control.redraw (int x, int y, int width, int height, boolean all), but looks like it doesn't do anything for child views when 'all' is true. May be this needs to be implemented, something similar to https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/171371
Comment 7 Matthias Becker CLA 2021-02-25 06:47:28 EST
(In reply to Lakshmi P Shanmugam from comment #6)
> I looked at ControlDecoration.update(). There is a call to Control.redraw
> (int x, int y, int width, int height, boolean all), but looks like it
> doesn't do anything for child views when 'all' is true. May be this needs to
> be implemented, something similar to
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/171371

I can help with testing if you need help.
Comment 8 Eclipse Genie CLA 2021-05-16 14:58:00 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/180642
Comment 9 Lakshmi P Shanmugam CLA 2021-05-20 06:25:01 EDT
(In reply to Eclipse Genie from comment #8)
> New Gerrit change created:
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/180642

@Matthias, can you please test the patch?
Comment 10 Yannic Soethoff CLA 2021-05-20 09:46:06 EDT
Thanks for the patch!
Matthias is currently on vacation, so I tested it and it works now as expected.
I've tested it on MacOS 11.2.3 and the latest Eclipse I-builds as DevIDE and also target platform.
Comment 11 Lakshmi P Shanmugam CLA 2021-05-20 11:02:41 EDT
(In reply to Yannic Soethoff from comment #10)
> Thanks for the patch!
> Matthias is currently on vacation, so I tested it and it works now as
> expected.
> I've tested it on MacOS 11.2.3 and the latest Eclipse I-builds as DevIDE and
> also target platform.

Thanks for testing!
Comment 13 Lakshmi P Shanmugam CLA 2021-05-24 06:27:22 EDT
Problem was also seen in base eclipse after Eclipse SDK level moved to 10.14 (Bug 572187).
Comment 14 Lakshmi P Shanmugam CLA 2021-05-27 06:59:31 EDT
Verified with I20210526-2310