| Summary: | [10.11] SWT can't receive input on non-standard JVMs | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Joshua Warner <allpowerful32> | ||||
| Component: | SWT | Assignee: | Lakshmi P Shanmugam <lshanmug> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | keith, lshanmug, mtpersson | ||||
| Version: | 4.6 | ||||||
| Target Milestone: | 4.6 M4 | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X | ||||||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=543773 | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 482454 | ||||||
| Attachments: |
|
||||||
Sorry, I don't have Avian JVM to verify the problem or the fix. Will you be able to verify the fix in a Nightly build, when it's committed? Also, can you please sign the CLA? (https://eclipse.org/legal/clafaq.php) CLA Signed. Although, I would humbly suggest it's a little silly to squabble over copyright assignment on such a tiny patch. Yes, I'll be able to verify the fix. FWIW, we've been running in production for a while now with the patched version of SWT. We've found no further issues. I'm also happy to help you build avian+swt+(an example app), should you want to verify the problem and solution yourself. (In reply to Joshua Warner from comment #2) > CLA Signed. Although, I would humbly suggest it's a little silly to > squabble over copyright assignment on such a tiny patch. Thanks! I don't see any squabble here. It is part of the eclipse process where we ask the contributor to sign the CLA when submitting a contribution for the first time. You don't have to do it with every contribution. The CLA of the author is automatically checked when a patch is submitted to source control system (git) or gerrit review. If the CLA is not signed the commit is rejected. Created attachment 257249 [details] patch Hi Joshua, This patch is based on your suggested changes. I've also made the same change in the Tracker class. Please test the patch in your setup. Also, can you verify if Tracker has the same problem and the patch fixes it? (Example snippets for Tracker - http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet31.java and http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet23.java) Thanks. Sorry for the delay. Confirmed; that patch fixes both issues (the general interaction and Tracker example) on avian + El Capitan. Thanks for the pointer on the Tracker example - that sped things up substantially! (In reply to Joshua Warner from comment #5) > Sorry for the delay. Confirmed; that patch fixes both issues (the general > interaction and Tracker example) on avian + El Capitan. Thanks for the > pointer on the Tracker example - that sped things up substantially! Thanks for testing the patch. Will commit post M3. Pushed to master > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a094f2f34315e9381b33e430a301d5b553d9ae11 Hi Joshua, Can you please verify the fix in the nightly build? Thanks! -->http://download.eclipse.org/eclipse/downloads/drops4/N20151104-2000/download.php?dropFile=eclipse-SDK-N20151104-2000-macosx-cocoa-x86_64.tar.gz (In reply to Lakshmi Shanmugam from comment #8) > Hi Joshua, > Can you please verify the fix in the nightly build? Thanks! > -->http://download.eclipse.org/eclipse/downloads/drops4/N20151104-2000/ > download.php?dropFile=eclipse-SDK-N20151104-2000-macosx-cocoa-x86_64.tar.gz The above N-build is no longer available, please verify in the latest I-build -- http://download.eclipse.org/eclipse/downloads/drops4/I20151117-0800/download.php?dropFile=eclipse-SDK-I20151117-0800-macosx-cocoa-x86_64.tar.gz Ping. This fix will be part of the 4.6M4 milestone build. Can you please verify it on a I-build (http://download.eclipse.org/eclipse/downloads/drops4/I20151207-2000/download.php?dropFile=eclipse-SDK-I20151207-2000-macosx-cocoa-x86_64.tar.gz) Thanks! For the record, I just want to add that this bug is most likely also the cause of bug 472259. It is just that Apple provided a workaround so that most Eclipse users are guarded from it. *** Bug 530267 has been marked as a duplicate of this bug. *** |
Scenario: * Any SWT-based app * Works fine on < OSX 10.11 * Works fine on OSX 10.11, when running through standard (oracle/openjdk) Java install * Breaks on OSX 10.11, when running through non-standard JVM (Avian, oss.readytalk.com/avian, in this case). This is not an Avian-specific issue. Expected: App renders correctly, and responds to input. Actual: App renders correctly, but never responds to any input, including menus, window close button. Appears frozen, except animations continue to render fine. We tracked the problem down to where NSApplication.nextEventMatchingMask is being called with a mask of 0. It looks like previously, this had the (undocumented) behavior of behaving like an "all events" mask. Presumably, this was updated in OSX 10.11 to mean "no events". Our theory is that Apple realized this broke some Java/SWT apps and decided to revert to the old behavior when the process name is "java", or some other sillyness. The patch that works for us is as follows. There's a similar usage in Tracker.java, but we don't happen to use that, and thus can't easily test that. ------------- diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java index ed7aefc..855fd76 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java @@ -3689,7 +3689,7 @@ public boolean readAndDispatch () { events |= runTimers (); events |= runContexts (); events |= runPopups (); - NSEvent event = application.nextEventMatchingMask(0, null, OS.NSDefaultRunLoopMode, true); + NSEvent event = application.nextEventMatchingMask(0xffffffffffffffffL, null, OS.NSDefaultRunLoopMode, true); if (event != null) { events = true; application.sendEvent(event); -------------