Community
Participate
Working Groups
Build Identifier: SWT 3.7.1GM Create an SWT Cocoa browser and an SWT combo, please see the sample. In the browser, press command+a to select all the content, and then command+c and command+v to do the copy/paste, repeat several times, then you will fail trying to click the combo box to show the drop-down list. Only reproduce in SWT Cocoa. Can not reproduce in SWT carbon. Reproducible: Always
Created attachment 207782 [details] Sample Sample
Grant, this happens to on Lion just after running the snippet (no need to select all, copy, etc). Please investigate.
Sorry, I spent time investigating this earlier in the cycle but I was not able to make a fix. Targeting for 4.2.1, which will be the next service release.
Hi Grant, As this bug is top sev-1 SPR for Notes, we are eager to a fix. Could you spend some more time to have a look? And we found some hint for it, yesterday, our Lotus Notes Mac team Dev found that it's related to a well known Mac bug as below: " NSComboBox popup getting dismissed on NSApp postEvent https://discussions.apple.com/thread/2188281?threadID=2188281&tstart=-5 apparently this is cause in what i believe is a bug in NSComboBox. NSComboBox starts its own event processing loop and when you use NSApplicationDefined events it closes the NSComboBox. only thing you can do is build into your architecture that events that use NSApplicationDefined are not sent while a NSComboBox is open. It seems the application defined event sent via NSApp postEvent by XULRunner caused this. Workaround is to fix XULRunner to not post the event while a NSComboBox is open. "
(In reply to comment #4) That certainly sounds similar to what we're seeing. Someone else reports something similar: http://lists.apple.com/archives/cocoa-dev/2005/Apr/msg01456.html . I've tried a workaround that eats all NSApplicationDefined events passing through our loop but it doesn't seem to help. The closing of the combo is often accompanied by an NSApplicationDefined event soon after, but not always. Still looking.
(In reply to comment #5) I changed all the 3 of [NSApp postEvent:...NSApplicationDefined...] to [NSApp postEvent:...NSSystemDefined...], and rebuilt a XULRunner-1.9.2.10 binary runtime. Such change did fix the problem. But not sure if such kind of change will conflic with other Apple built-in NSSystemDefined event. It will be better if we can workaround by modifying SWT code, instead of xulrunner code.
(I'm using XULRunner 10) The second postEvent: in nsAppShell::ProcessGeckoEvents() is where the problematic event is posted. These particular events are triggered by a timer. Most events posted from here reach SWT's event loop without problem, but these ones do not. XULRunner contains some #nextEventMatchingMask()s invoations, but they do not appear to be eating these disappearing events. So either swt is somehow failing to access all events in the loop (eg.- are they posted on another thread?), or the events are being eaten somewhere before swt has a chance to see them. If they are being eaten then I don't think this is fixable in swt. However the first possibility needs further investigation.
Fixed > 20120528, patch: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=1587016128f120779b698d8ab37efa85ed9c8e7c .
(In reply to comment #8) Hi Grant, Would you please confirm if above link is to the fix for this bug #365280? Could you summary how this is fixed?
Sorry, wrong link to the patch, it should be: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R3_8_maintenance&id=f892b6419893d6fb0c860079de38ff367a495210 . (I assume this was the source of the confusion).
(In reply to comment #10) Grant, Thanks for your patch. But it look like that the code of mozillaCount is not needed. Because, even all browser are disposed, the Mozilla event loop will be still active and there will be still some nsApplicationDefined event. And, it will be perfect if we can query and check the event subtype.
I don't have a Mac in front of me at the moment, the following is based on what I remember from yesterday: > Grant, Thanks for your patch. But it look like that the code of mozillaCount > is not needed. Because, even all browser are disposed, the Mozilla event loop > will be still active and there will be still some nsApplicationDefined event. The goal is to run the workaround in Display as infreqently as possible. At a minimum, only running it after a Mozilla-style Browser has been created ensures that it does not run in SWT's 99% case, which is no Mozilla-style Browser created on Mac (most apps, including Eclipse, only create Browsers with style SWT.NONE). Also, not running the workaround when the Mozilla Browser count goes from > 0 to 0 worked well yesterday when I modified the test snippet to create/destroy Browser instances as requested. The workaround was not needed after the Browser on the test page was disposed. > And, it will be perfect if we can query and check the event subtype. We looked at the Mozilla NSApplicationEvent subtypes during yesterday's investigation and they were always 0, which does not seem useful (?).
(In reply to comment #12) Basing on the sample attached to this bug report, I added a button to dispose the browser. My test show that the workaround is still needed after browser is disposed. I guess the different test results may be caused by various xulrunner version. For the NSApplicationDefined post by XULRunner, all subtype is 0. I assume that other NSApplicationDefined events are likely post with a different subtype.
I've released an update to the fix, the patch is http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R3_8_maintenance&id=aed115314f5d03f242d0bf452d6cae2ebf4a5d20 . Once a Mozilla-based Browser is created then the workaround remains until execution is complete. The subtype check was not added because the NSCombo behaviour would be affected by any NSApplicationDefined event, not just one originating in XULRunner.