Bug 292882 - [IDE] [browser] Default external browser should be pre-configured on Solaris 10 sparc GTK
Summary: [IDE] [browser] Default external browser should be pre-configured on Solaris ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: Sun Solaris
: P3 major (vote)
Target Milestone: 3.6 M3   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 94497 286314
Blocks: 288140
  Show dependency tree
 
Reported: 2009-10-21 08:30 EDT by Paul Webster CLA
Modified: 2009-10-27 15:03 EDT (History)
30 users (show)

See Also:


Attachments
Improved patch fixing the issue (3.91 KB, patch)
2009-10-23 18:01 EDT, Martin Oberhuber CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2009-10-21 08:30:55 EDT
We need to release the attachment (id=149453) fix in 3.6

+++ This bug was initially created as a clone of Bug #288140 +++

On Solaris 10 SPARC, the default location of the web browser is
   /usr/sfw/lib/mozilla 
As per bug 77217 comment 41.

If a mozilla is indeed detected in that location, the corresponding Preference
should be set automatically under General > Web Browser > External Web
Browsers.

Moreover, Solaris 10 is a GTK / Gnome based system, and does have the concept
of a default web browser just like Linux-GTK. When I launch a newly downloaded
Firefox and allow it to register as default web browser, the following happens:

(1) $HOME/.gnome/application-info/user.applications
    receives an Entry with ID "Firefox" pointing to my browser's install dir

(2) $HOME/.gnome/mime-info/user.keys
    receives entries for text/html and application/xhtml+xml pointing to
    default_application_id=Firefox

I see that Eclipse on other other Platforms does automatically set this
"Default system web browser" Preference, so I'd expect it to be set on Solaris
as well. 

The benefit of this fix would be that Solaris users don't have to manually
enter their browser location any more.
Comment 1 Chris Goldthorpe CLA 2009-10-21 11:49:47 EDT
Patch applied to HEAD, resolving as Fixed.
Comment 2 Martin Oberhuber CLA 2009-10-23 17:11:45 EDT
I tested this with N20091022-2000 on Solaris 10 and Solaris 9, and unfortunately the patch is not as perfect as I hoped.

On Solaris 10, everything is fine. 

On Solaris 9, though, the following happens:
  - Under Preferences > Web Browsers I see 2 entries:
     (a) Default System Web Browser
     (b) Netscape (/usr/dt/bin/netscape)
    with the default system one preselected.

Unfortunately, doing Help > Help Contents FAILS without any message with this default setting. I am not exactly sure whether this is bug 94497 or anything else. 

When I switch Preferences to Netscape, doing Help > Help Contents WORKS.

I think that the best for now will be revising the patch to set the default browser only on Solaris when the OS Version is Solaris 10 or higher. I'm not yet sure how to detect the OS Version on Solaris though.
Comment 3 Martin Oberhuber CLA 2009-10-23 17:12:26 EDT
One other option might be detecting the "Default System Browser" only when no other browser has been found / configured.
Comment 4 Chris Goldthorpe CLA 2009-10-23 17:35:38 EDT
Looks like we need to back out the patch for M3 while we figure out what to do next. I will do that next week.
Comment 5 Martin Oberhuber CLA 2009-10-23 18:01:45 EDT
Created attachment 150419 [details]
Improved patch fixing the issue

Attached improved patch (against 3.6 HEAD) fixes the issue.
Developed on Solaris 9, tested on Solaris 10.

I read up on bug 94497 again, to find that as per bug 94497 comment 49, the most likely culprit for the SWT Program.findProgram("html") not working on Solaris 9 is the Solaris ToolTalk / dt integration. As per bug 94497 comment 56, the solution was to disable Program.findProgram() functionality for Solaris altoghether, and add a hardcoded path to the default system browser in /usr/dt/bin/netscape instead.

My improved patch makes sure that the problematic SWT Program.findProgram() call is only made on Solaris when running on GTK, AND when running on Solaris 10 or higher, where the ToolTalk / dt integration has been replaced by Gnome. Moreover, to be even safer, I added the default Solaris system browser path ("/usr/sfw/lib/mozilla/mozilla") in plugin.xml -- to help users who really manage to mess up their GNOME html associations, which I managed as documented in bug 286314.

I think a real fix for the broken Program.findProgram() issue must be in SWT as requested by bug 286314. For now though, the current solution should be good enough.
Comment 6 Martin Oberhuber CLA 2009-10-23 18:02:48 EDT
I'm having this bug block the backport since it must be validated in 3.6m3 first. But I'm quite positive now that there are really no more issues :)
Comment 7 Martin Oberhuber CLA 2009-10-23 18:22:12 EDT
PS if anybody is still worried about Program.findProgram() we could simply only leave my change to plugin.xml in there.

The plugin.xml method will always find the default system web browser, which is always in the same location on Solaris and always known to work. 

The effect of the Program.findProgram() method is this: a person who downloads e.g. a newer version of Firefox and runs that once, gets the option to make that newer Firefox their default browser. The default browser association is stored in their Gnome desktop settings, and the SWT Program class reads these settings by leveraging Gnome native libraries.

I guess that a user who downloaded a different browser may legally expect that downloaded and registered default browser to be used. On the other hand, I have seen downloaded and registered Mozilla browsers affect the internal browser badly as documented on bug 77217 comment 59. The system browser may not be perfect and pretty, but it is always a safe bet.

From a user's perspective, I want (proritized list)
  * The default setting to always work safely
  * Ability to manually override the default setting if necessary
  * Optionally pick up an improved setting automatically.

I guess what I would recommend is this release my updated patch into 3.6m3 for wider community exposure. I hope to find time to verify with an upcoming I-build that the internal browser integration from bug 77217 as well as the external browser help opening is not negatively affected by a downloaded and registered newer firefox.
Comment 8 Martin Oberhuber CLA 2009-10-23 18:31:13 EDT
I verified with N20091022-2000 (which contains the problematic Program.findProgram() call) and a downloaded registered firefox-3.5.2 on Solaris 10 that

1. The internal browser still works,
2. Help still works,
3. Help displays in the registered downloaded browser (rather than system mozilla)

So I think we are really good to go with this patch. All my acceptance criteria are met.
Comment 9 Chris Goldthorpe CLA 2009-10-26 12:37:27 EDT
I have committed the improved patch.
Comment 10 Paul Webster CLA 2009-10-27 13:59:28 EDT
Could someone with Solaris 10 confirm this on the http://download.eclipse.org/eclipse/downloads/drops/I20091027-0100/ build.

Thanx,
Paul
Comment 11 Grant Gayed CLA 2009-10-27 14:56:09 EDT
I've confirmed on Solaris 10 SPARC that Help > Help Contents works out of the box, and Preferences > Web Browsers shows one entry.  These still work on OpenSolaris x86 as well.
Comment 12 Paul Webster CLA 2009-10-27 15:03:25 EDT
(In reply to comment #11)
> I've confirmed on Solaris 10 SPARC that Help > Help Contents works out of the
> box, and Preferences > Web Browsers shows one entry.  These still work on
> OpenSolaris x86 as well.

Thanx
PW