Bug 49696 - [browser] Mouse event listeners does not work in SWT Browser Widget
Summary: [browser] Mouse event listeners does not work in SWT Browser Widget
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P2 major with 6 votes (vote)
Target Milestone: 3.3   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-08 10:24 EST by Seth Chisamore CLA
Modified: 2008-01-02 17:13 EST (History)
14 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Seth Chisamore CLA 2004-01-08 10:24:47 EST
When using the SWT Browser widget the mouse events (mouseDown, mouseUp, 
mouseDoubleClick) do not fire after adding a mouselistener to the Browser 
widget (browser.addMouseListener).  This can be recreated by creating a 
browser widget object with the mouse listener and then clicking inside of the 
browser window.
Comment 1 Morten Moeller CLA 2004-10-03 11:48:06 EDT
Not does the mouse listener not work on a browser, the global event filter
doesn't work on it either. Might be related of course.

This means the Browser class works totally different compared to all the other
SWT widgets...

....getDisplay().addFilter(SWT.MouseDown, new Listener() {

    public void handleEvent(Event event) {
        // never called for mouse events inside the browser, but does 
        // get called for all other mouse events.
        System.out.println(">> MouseDown " + event); 
    }        	
});

Comment 2 Stefan Zeiger CLA 2004-12-08 11:44:52 EST
Note that this bug prevents an important application of the new mouse button
support for buttons 4 and 5 (bug #7101). These buttons cannot be assigned to the
usual "back" and "forward" actions in a browser.
Comment 3 Florian Thienel CLA 2005-02-16 02:57:12 EST
On Windows platforms there is a similar problem with ActiveX components and key
events (see bug #49699). Maybe these bugs are related.
Comment 4 Benjamin Pasero CLA 2005-02-16 05:09:11 EST
I dont think the missing Events of the Browser widget (Mouse, Key, Focus) are
caused by bugs, but simply because they are not yet implemented. I really hope
they will become implemented in the 3.1 dev cycle.

Ben
Comment 5 Christophe Cornu CLA 2005-02-16 13:27:54 EST
Yes. We are investigating support for these for 3.1. 
Comment 6 David Thomson CLA 2005-04-11 18:06:55 EDT
Perhaps this project might help:

http://justthe.net/jrex/

While I should probably make a feature request to get something like this fully
supported, it might give some ideas about how to handle events when dealing with
an embedded browser.

BTW, the URL for the main project is jrex.mozdev.org.

David
Comment 7 Eric Zimmerman CLA 2005-10-12 11:13:54 EDT
(In reply to comment #5)
> Yes. We are investigating support for these for 3.1. 

Has anything become of this investigation?  Are there plans or code already
written to solve this issue?  

I also hope that the mouse events are cancellable to allow for removal of right
context clicks before they reach the native browser object.

Comment 8 Benjamin Pasero CLA 2005-10-13 02:49:19 EDT
> I also hope that the mouse events are cancellable to allow for removal of right 
> context clicks before they reach the native browser object.

That can be achieved by calling setMenu(new Menu()) on the Browser.

Ben
Comment 9 Grant Gayed CLA 2005-10-14 17:36:22 EDT
I've taken an initial look at this and have partial solutions.  Pages with 
frames are much more problematic than pages without.

As a side note, this does work on Mac with the exception of MouseMove.
Comment 10 pwsomers CLA 2006-03-09 16:26:51 EST
(In reply to comment #9)
> I've taken an initial look at this and have partial solutions.  Pages with 
> frames are much more problematic than pages without.
> 
> As a side note, this does work on Mac with the exception of MouseMove.
> 

Grant,

Is there any chance that this critical Browser problem will be addressed any time soon?

Thanks.

... Phil
Comment 11 Grant Gayed CLA 2006-03-10 10:02:31 EST
There are currently other work items with higher priority.  However since there are patches that capture a partial solution I should be able to at least revisit this during the 3.2 timeframe.  The merits of having a partial solution (assuming that time constraints prevent further investigation) will be determined then.
Comment 12 Grant Gayed CLA 2006-04-03 17:44:37 EDT
This will likely not be in for 3.2; there are too many higher priority bugs in the browser and gtk 64-bit spaces for the time that remains according to the recently-posted endgame plan.
Comment 13 Grant Gayed CLA 2007-03-30 09:17:31 EDT
To update, the following mouse events are now fired on linux-gtk (both browser styles) and win32 (if Browser style is SWT.MOZILLA):

down, up, doubleClick, enter, exit, move

Also, all of these except for move are fired on OSX (both browser styles).

So what's left, hopefully will be addressed for 3.3:
- win32 (all of these for SWT.NONE browser style)
- OSX (just move for both browser styles)
Comment 14 Francis Leboutte CLA 2007-04-18 04:45:08 EDT
Hello Grant,

It seems that on Windows we have to wait anyway because the Mozilla Browser style will be available in 3.3 release only. I'm especially interrested in the move event, including using addFilter.

Moreover having these events on Window with SWT.NONE is critical because I think forcing the users to install Firefox and XULRunner on their system is not practical.

Thank you,

Francis
Comment 15 Grant Gayed CLA 2007-04-26 14:14:29 EDT
To update, this is now implemented on win32 for Browsers with style SWT.NONE.  So this leaves MouseMove on OSX.
Comment 16 Grant Gayed CLA 2007-11-28 09:53:53 EST
*** Bug 211224 has been marked as a duplicate of this bug. ***
Comment 17 Dani Megert CLA 2007-12-04 10:29:18 EST
Any plans we can get this for 3.4?
Comment 18 Carolyn MacLeod CLA 2007-12-04 10:56:14 EST
You mean just MouseMove on OSX, right?

Grant, we sould close this bug (49696) as "fixed" with a note that the only remaining problem is addressed in bug 211224, and then reopen 211224.
This bug is too 'global', and the title is too confusing now that the original bug is almost completely fixed.
Comment 19 Dani Megert CLA 2007-12-04 12:29:20 EST
>You mean just MouseMove on OSX, right?
Yes.
Comment 20 Markus Keller CLA 2007-12-10 10:15:06 EST
(In reply to comment #18)
> You mean just MouseMove on OSX, right?

Safari (OS X 10.4.11) misses MouseMove, MouseUp, and DragDetect (on links). I really need the first two. I've opened bug 212416 for DragDetect (also missing on GTK/Mozilla).
Comment 21 Grant Gayed CLA 2008-01-02 17:13:42 EST
re: comment 18
Yes this makes sense.  I've reopened bug 211224 and am marking this report as fixed in 3.3.