Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 570428 - [macOS] Showing splash screen causes menu to not be clickable
Summary: [macOS] Showing splash screen causes menu to not be clickable
Status: VERIFIED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Launcher (show other bugs)
Version: 4.19   Edit
Hardware: Macintosh Mac OS X
: P3 minor (vote)
Target Milestone: 4.19 M3   Edit
Assignee: Alex Blewitt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 552063
Blocks:
  Show dependency tree
 
Reported: 2021-01-17 13:09 EST by Alex Blewitt CLA
Modified: 2021-02-12 13:12 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2021-01-17 13:09:06 EST
As in bug 552063, macOS has changed the way in which the menu needs to be activated prior to running. Calling `activateWithOptions` in the main thread prevents menu items to be shown; instead, it should be called from the application's delegate applicationDidFinishLaunching callback, as per the investigation in https://stackoverflow.com/questions/62739862

Investigation is further needed, but removing the call to `[[NSRunningApplication currentApplication] activateWithOptions: NSApplicationActivateIgnoringOtherApps];
` in eclipseCocoa.c may be sufficient; however, it may be that the early call is causing additional issues.
Comment 1 Thomas Watson CLA 2021-01-20 09:26:57 EST
I assume this belongs to launcher.
Comment 3 Alex Blewitt CLA 2021-01-20 10:15:47 EST
Once we've got bug 552063 merged, I can take a look at this and see what needs to be done in order to fix the launcher on macOS as well.
Comment 4 Alex Blewitt CLA 2021-01-25 04:58:15 EST
The blocking bug has been merged so I can look at this. Are there instructions on how I can build the Equinox launcher for macOS?
Comment 5 Eclipse Genie CLA 2021-02-06 15:10:31 EST
New Gerrit change created: https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/175929
Comment 7 Lakshmi P Shanmugam CLA 2021-02-12 06:52:44 EST
Thanks for fixing this, Alex!
Comment 8 Alex Blewitt CLA 2021-02-12 09:02:11 EST
Verified fixed in I20210211-1810
Comment 9 Alex Blewitt CLA 2021-02-12 09:08:02 EST
NB when launching the app from the command line (e.g. Eclipse.app/Contents/MacOS/eclipse) doesn't show the splash screen at the front and/or the workspace choosing dialog - they have to be clicked to activate.

When double-clicking the Eclipse.app (or using 'open Eclipse.app') the application is brought to the foreground as expected.

I'm recording this observation here in case there's automation that requires on the application splash screen or workspace chosing dialog to the front, though I expect that such tools will be called with an explicit -data argument.

When an explicit -data argument is supplied, the application does bring the splash screen to the front after it successfully launches.
Comment 10 Lakshmi P Shanmugam CLA 2021-02-12 10:14:08 EST
(In reply to Alex Blewitt from comment #9)
> NB when launching the app from the command line (e.g.
> Eclipse.app/Contents/MacOS/eclipse) doesn't show the splash screen at the
> front and/or the workspace choosing dialog - they have to be clicked to
> activate.
> 
> When double-clicking the Eclipse.app (or using 'open Eclipse.app') the
> application is brought to the foreground as expected.
> 
> I'm recording this observation here in case there's automation that requires
> on the application splash screen or workspace chosing dialog to the front,
> though I expect that such tools will be called with an explicit -data
> argument.
> 
> When an explicit -data argument is supplied, the application does bring the
> splash screen to the front after it successfully launches.

Hi Alex,
Thanks for adding this note here. Why does this happen when launching from command line?
I think launching eclipse from command line (without the data argument) is common use case and we shouldn't break it.
Comment 11 Alex Blewitt CLA 2021-02-12 13:12:35 EST
It's not broken as such; the splash screen is still displayed as is the workspace dialog, but the fix here (which removes the bring-to-front functionality) needs to be handled by the application start up handler, which is called after the dialog choice is shown. We could move it to the latter.

It's incredibly rare for macOS applications to be launched on the command line; most people won't know how to do it, or will just use 'open' on the Eclipse.app, which will continue to work as expected.

Running Eclipse.app/Contents/MacOS/eclipse still works, and you can click on the launch selection dialog and enter the location as expected; you can also pass -data and it will work as before. Once the choose-your-own-adventure workspace dialog is dismissed, the splash screen comes to the front again. In any case, if you've chosen the dialog and done the 'remember this for next time' checkbox it won't be a problem either.

The majority of Eclipse users will never notice any difference here but will notice the difference in the launch from an Eclipse app or other RCPs.

If this causes a significant issue and we need to investigate it further, one option would be to have an additional flag for macOS that triggers the behaviour before which is encoded in the eclipse.ini but not in the PDE launch, or vice versa. There's also a possibility that we could look into another approach of when/where/how the workspace chooser dialog is shown.