Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350098 - [hovering] "Enrich on click" is not working on Indigo
Summary: [hovering] "Enrich on click" is not working on Indigo
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 3.8 M7   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-22 16:11 EDT by Andre Costa CLA
Modified: 2012-04-12 12:07 EDT (History)
5 users (show)

See Also:


Attachments
patch that uses new WebKitGTK DOM API (48.29 KB, application/octet-stream)
2011-07-20 12:02 EDT, Grant Gayed CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Costa CLA 2011-06-22 16:11:20 EDT
Build Identifier: 20110615-0604

Setting "Preferences > General > Editors > Text Editors > When mouse moved into hover" to  "Enrich on click" is ineffective on Indigo (it works on Helios). Pressing F2 while the hover has the focus works as expected, though.

Tested with JDK 6u26 x86_64 on GNOME 3 (Fedora 15).

Reproducible: Always

Steps to Reproduce:
1. configure "Enrich on click" for hovers, as described above
2. hover over a class name
3. click on the hover
Comment 1 Dani Megert CLA 2011-06-23 05:37:46 EDT
Are you using 3.7 or 4.1? Which browser do you use? Works for me on both using Windows 7.

Markus, please take a look.
Comment 2 Markus Keller CLA 2011-06-23 05:46:30 EDT
> is ineffective

What does that mean? Is the hover enriched earlier or not at all? Please attach a screenshot of a Javadoc hover that should show links, e.g. String#charAt(int).
Comment 3 Andre Costa CLA 2011-06-23 09:52:12 EDT
(In reply to comment #1)
> Are you using 3.7 or 4.1? Which browser do you use? Works for me on both using
> Windows 7.

I'm using Indigo release (3.7), sorry for the miscategorization. As for the browser, I have both Chrome (12.0.742.100) and Firefox (4.0.1-2), Chrome being the default browser.
Comment 4 Andre Costa CLA 2011-06-23 10:21:41 EDT
(In reply to comment #2)
> > is ineffective
> 
> What does that mean? Is the hover enriched earlier or not at all? Please attach
> a screenshot of a Javadoc hover that should show links, e.g.
> String#charAt(int).

The hover is displayed just fine, and links appear and work as expected. What doesn't happen is that when I click the hover outside of a link nothing happens, and it should "enrich" (show scrollbars and navigation buttons, which does happen when I press F2 while the hover is displaying). It also doesn't enrich if I use the mouse wheel over the hover.

At first I thought it was related to GNOME 3, but hovers work as expected on Helios on the same system.
Comment 5 Markus Keller CLA 2011-06-23 10:38:43 EDT
OK, then it's very likely a problem with the WebKit browser renderer (Indigo uses WebKit by default, whereas Helios used Mozilla).

Unfortunately, I don't have a Linux machine with WebKit installed, so it's hard for me to find the exact problem. Our implementation uses a display listener for MouseUp in org.eclipse.jface.text.AbstractHoverInformationControlManager:311 that should get an event when the user releases the mouse.

Looks like this event is not fired with WebKit.

Moving to SWT. Please move back if my guess was wrong.
Comment 6 Andre Costa CLA 2011-06-23 14:28:36 EDT
I did some additional tests:

1. I tried to run Helios forcing WebKit rendering using -Dorg.eclipse.swt.browser.UseWebKitGTK=true, but it doesn't work because Fedora 15 ships with WebKit 1.4.0, and according to SWT FAQ Helios can only use WebKitGTK 1.2. So, hovers do enrich on click with Helios, but links appear as plain text etc.

2. I tried running Indigo with org.eclipse.swt.browser.UseWebKitGTK set to false, but it didn't help (hovers still don't enrich on click). Not sure though if setting this property to false would force Indigo to use Mozilla as browser renderer

WebKit versions installed are:

webkitgtk-1.4.1-1.fc15.x86_64
webkitgtk3-1.4.0-1.fc15.x86_64
Comment 7 Markus Keller CLA 2011-06-23 14:51:56 EDT
(In reply to comment #6)
> 1. I tried to run Helios forcing WebKit rendering [..]
Then you get the fallback that doesn't use the Browser widget at all (no links).

> 2. I tried running Indigo with org.eclipse.swt.browser.UseWebKitGTK set to
> false [..]
Yeah, that doesn't disable WebKit, see bug 349837 comment 12.
Comment 8 Andre Costa CLA 2011-06-23 15:52:35 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > 1. I tried to run Helios forcing WebKit rendering [..]
> Then you get the fallback that doesn't use the Browser widget at all (no
> links).
> 
> > 2. I tried running Indigo with org.eclipse.swt.browser.UseWebKitGTK set to
> > false [..]
> Yeah, that doesn't disable WebKit, see bug 349837 comment 12.

Thks for the info. Well, I am out of ideas, please let me know if I can help in any other way.
Comment 9 Markus Keller CLA 2011-06-24 08:40:54 EDT
> please let me know if I can help in any other way.

If you want to help the SWT team debugging this, you can launch the ControlExample [1] as a Java Application, go to the Browser tab, select the Listen checkbox, and then see whether you get a MouseUp event when you click into the browser.

The situation in the hover is a bit more complicated since the shell that contains the browser is not active initially. Maybe a more similar situation could be created in the ControlExample when you click 'Set/Get API' and then click the browser.

[1] CVS repository :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
Check out org.eclipse.swt.examples from HEAD.
Comment 10 Grant Gayed CLA 2011-06-24 13:01:44 EDT
re: comment 9
WebKitGTK-based Browsers do generally send key/mouse events, but the one case where they don't, and I think this applies to this bug, is if JS is disabled in the Browser.  This is because WebKitGTK versions earlier than 1.4 did not provide an embedder API for getting DOM events, so the Browser had to fall back to getting them via JS events.  I believe that WebKitGTK 1.4 introduced embedder API for accessing the dom, so fixing the Browser to use them should allow it to get its events regardless of whether JS is enabled or not.
Comment 11 Andre Costa CLA 2011-06-27 09:07:24 EDT
FYI: I just tested Indigo on Ubuntu 11.04 and hovers also don't enrich on click (WebKit version is 1.3.13).
Comment 12 Grant Gayed CLA 2011-07-20 12:02:03 EDT
Created attachment 200020 [details]
patch that uses new WebKitGTK DOM API

Using the new WebKitGTK DOM API does not fix the problem.  Doing this works fine in the OSX port of WebKit, so I think this is either a bug in WebKitGTK, or JS disablement is not being done correctly.

Attaching patch here so that the work is not lost.  This is a change that should be made regardless.  Will continue investigating this case.
Comment 13 Grant Gayed CLA 2011-08-11 11:21:43 EDT
*** Bug 353305 has been marked as a duplicate of this bug. ***
Comment 14 Grant Gayed CLA 2011-11-28 12:39:51 EST
*** Bug 364908 has been marked as a duplicate of this bug. ***
Comment 15 Markus Keller CLA 2012-03-05 18:52:53 EST
Should this bug get a 3.8 target?