Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 270948 - Webstart : MacOSX : no mouse down events on canvas
Summary: Webstart : MacOSX : no mouse down events on canvas
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5   Edit
Hardware: All Mac OS X
: P3 normal with 1 vote (vote)
Target Milestone: 3.6 M2   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 287379 (view as bug list)
Depends on:
Blocks: 268733
  Show dependency tree
 
Reported: 2009-04-02 08:02 EDT by Nicolas Richeton CLA
Modified: 2010-06-28 18:40 EDT (History)
10 users (show)

See Also:


Attachments
Display patch for AWT events (6.40 KB, patch)
2009-05-11 12:11 EDT, Scott Kovatch CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Richeton CLA 2009-04-02 08:02:57 EDT
I'm working on Nebula webstart example. 
On OSX / cocoa, mousedown events are not fired on canvas (Gallery custom widget) : I cannot select on item on the gallery example tab.

but they work for : 
OSX /cocoa without webstart
Win32 both with and without webstart

the jnlp file includes -XstartOnFirstThreat

See : http://nricheton.homeip.net/public/nebula/nebula.jnlp
Comment 1 Felipe Heidrich CLA 2009-04-02 09:33:22 EDT
This demo seems very large (>18Mb).

Can you attach a simple (SWT only, no nebula) webstart sample that shows the problem ?

Silenio, do you we support webstart for cocoa ?
Comment 2 Nicolas Richeton CLA 2009-04-02 12:13:20 EDT
I won't be able to create a new webstart application before tomorrow. In the meantime the nebula app can still be used to view this problem. I know this is not the best , but at least this shows the problem. :)
Comment 3 Scott Kovatch CLA 2009-04-04 23:39:48 EDT
Cocoa SWT isn't going to work with the AWT yet because the AWT has already installed its own NSApplication. I have some local changes related to SWT/AWT embedding that should address this -- we need to call the superclass NSApplication methods we override if the event goes to a window not in the SWT's control.
Comment 4 Bastian CLA 2009-05-09 17:39:11 EDT
hoi scott. can you please commit your fix or provide a patch. My application is almost unusable due to this bug (started with JWS on mac/cocoa). Btw. StyledText is also affected :(
Comment 5 Scott Kovatch CLA 2009-05-11 12:11:09 EDT
Created attachment 135165 [details]
Display patch for AWT events

This is a patch on Display that should help. If there is an NSApplication in place it overrides it on the fly, and if it doesn't find a Display because the wrong thread is running, it calls the superclass handler.
Comment 6 Bastian CLA 2009-05-13 15:49:28 EDT
the patch works like a charm. Thanks. here in action: http://www.brainpot.de/jws/brainpot.jnlp
Comment 7 Scott Kovatch CLA 2009-05-13 16:10:28 EDT
(In reply to comment #6)
> the patch works like a charm. Thanks. here in action:
> http://www.brainpot.de/jws/brainpot.jnlp

Excellent! 

Kevin, Silenio, I think we should consider this for RC1 or RC2 -- AWT coexistence (in this case, with Web Start) is a pretty important feature.
Comment 8 Silenio Quarti CLA 2009-05-14 10:16:01 EDT
The callbacks (applicationCallback2, etc) are static, so they should be created only once. 

Why we need to save the old impl (curr_sendEvent, etc). It seems that they should be used in Display.applicationProc() instead of calling super. Should they be put back when the display is disposed?

In the isEmbedded case, should we call method_setImplementation() instead of class_addMethod()? What is the difference?

Does AWT subclasses NSApplication as well? When we call super in Display.applicationProc(), are we bypassing AWT?

Sorry, I could get some of the answers myself, but I have not been able to run the code yet.
Comment 9 Steve Northover CLA 2009-05-19 14:01:57 EDT
The patch has some problems and we don't have time to address them all.  I suggeset we defer to 3.5.1 or 3.6.  I believe there are too many code changes for 3.5 RC3.
Comment 10 Silenio Quarti CLA 2009-08-28 14:31:47 EDT
*** Bug 287379 has been marked as a duplicate of this bug. ***
Comment 11 Silenio Quarti CLA 2009-08-28 14:49:16 EDT
Fixed > 20090828
Comment 12 Scott Kovatch CLA 2009-08-28 15:50:38 EDT
Silenio, in Display.java I see:

static int /*long*/ applicationProc(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) {
	//TODO optimize getting the display
	Display display = getCurrent ();
	if (display == null) return 0;
	if (display == null) {


Did you mean to leave in the first "display == null" check? The next if test never executes in that case.
Comment 13 Silenio Quarti CLA 2009-08-28 16:17:23 EDT
Good catch. Thanks!
Comment 14 Kevin Pollet CLA 2009-08-31 05:32:17 EDT
It works fine !

Thanks.
Comment 15 Zuber Syed CLA 2009-09-07 06:01:52 EDT
Is this patch release in any of the build ?

I have logged similar kind of issue my bug id is 288219.

If the patch is not released please let me know where to get jar which has this patch.

Your help in this issue is desparately needed.

Thanks!
Comment 16 Silenio Quarti CLA 2009-09-08 11:28:02 EDT
This build has the fix.

http://download.eclipse.org/eclipse/downloads/drops/I20090901-0800/index.php
Comment 17 Edvin Syse CLA 2010-01-09 17:57:40 EST
(In reply to comment #16)
> This build has the fix.
> 
> http://download.eclipse.org/eclipse/downloads/drops/I20090901-0800/index.php

This link is dead (404). It would be great if someone could provide a working link to a version with this patch.
Comment 18 Scott Kovatch CLA 2010-01-09 18:21:10 EST
(In reply to comment #17)
> This link is dead (404). It would be great if someone could provide a working
> link to a version with this patch.

Pick any of the recent Integration builds -- the fix has been checked in for some time now. Even a 3.6 M build will have it.
Comment 19 Scott Kovatch CLA 2010-06-28 18:40:36 EDT
Bug was fixed but the patch wasn't used, so I'm cleaning up the review flag.