Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 285888 - Should cocoa be the default ws on MacOSX?
Summary: Should cocoa be the default ws on MacOSX?
Status: RESOLVED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M2   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-06 10:54 EDT by Andrew Niefer CLA
Modified: 2009-08-17 18:23 EDT (History)
5 users (show)

See Also:


Attachments
fix + test (2.80 KB, patch)
2009-08-07 12:32 EDT, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Niefer CLA 2009-08-06 10:54:48 EDT
When starting without the native launcher and with -ws, we guess a default ws based on the OS.  For the mac, the default is carbon.  Should we consider changing this to cocoa?

I guess this may depend on the download stats for the two platforms.

See for example the log attached to bug 285513, this was irrelevant there, but if we had been trying to run an app that wasn't headless it would have failed.


There are two places to make this change, EclipseEnvironmentInfo#guessWS and Main#getWS
Comment 1 Kevin Barnes CLA 2009-08-06 11:14:51 EDT
I think guessing cocoa makes sense going forward. We're concentrating our efforts on cocoa more so than carbon for 3.6 and beyond.
*Carbon still needs to work though.
Comment 2 Thomas Watson CLA 2009-08-07 11:51:49 EDT
This is similar to bug 185952 when we switched from motif to GTK.  We should do this early in 3.6.  Note that we will have automated testcases to update as well.
Comment 3 Thomas Watson CLA 2009-08-07 12:32:17 EDT
Created attachment 143786 [details]
fix + test

Here is the fix and updated test.
Comment 4 Thomas Watson CLA 2009-08-12 11:39:45 EDT
We discussed this at the architecture call.  The following concerns were raised:

1) Any time we change the default behavior there are concerns about backwards compatibility.  Is it worth the change?  Is it really that important to change the default here?

2) Is there a better way to guess?  Could we look to see what native codes are installed and guess based on that (e.g. the SWT fragment for cocoa is present).  This is not likely to be straight forward because we have not even gotten to p2 yet to install the SWT fragments before we need to guess.

3) Should we mandate that -ws or osgi.ws is set in the launcher instead and print some message if it is not specified?  Perhaps exit?  Although I think exiting would pose a greater concern about backwards compatibility (think headless apps that don't care about the ws).
Comment 5 Dani Megert CLA 2009-08-12 11:43:12 EDT
-1 for option 3) this is more breaking than just switching the default. Better guessing e.g. based on what's installed sounds tempting. If this doesn't work out then I'd switch the default to Cocoa given that's what Apple suggests to use for new apps.
Comment 6 Andrew Niefer CLA 2009-08-12 11:53:29 EDT
The Main class will look for the launcher fragment, one strategy for a better guess is if we fail to find the default, we can look for the other one.  Finding the non default could have Main pass the corresponding -ws to the framework.
Comment 7 Thomas Watson CLA 2009-08-12 11:55:11 EDT
(In reply to comment #6)
> The Main class will look for the launcher fragment, one strategy for a better
> guess is if we fail to find the default, we can look for the other one. 
> Finding the non default could have Main pass the corresponding -ws to the
> framework.
> 

Ah, I forgot the launcher did the search for a launcher fragment.  I think this may be a feasible solution.
Comment 8 Andrew Niefer CLA 2009-08-12 11:55:53 EDT
(In reply to comment #6)
> The Main class will look for the launcher fragment, one strategy for a better
> guess is if we fail to find the default, we can look for the other one. 
> Finding the non default could have Main pass the corresponding -ws to the
> framework.
> 

This would involve defining the alternate ws, which is rather straightforward:
gtk <-> motif
carbon <-> cocoa (or cocoa->carbon)
win32 <-> wpf (? perhaps unnecessary)
Comment 9 Andrew Niefer CLA 2009-08-12 17:38:23 EDT
I raised bug 286453 and attached a patch there for trying an alternate ws when the default is not found.

Independently, we can either change the mac default to cocoa, or close this as won't fix.
Comment 10 Thomas Watson CLA 2009-08-12 17:49:31 EDT
I don't think we should change the default at this point.  The fix in bug 286453 should provide the behavior we want.