aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-11-23 09:09:17 +0100
committerSven Gothel <[email protected]>2012-11-23 09:09:17 +0100
commitf24844c5e6c57a43df79224f2d3a89e9720726f7 (patch)
tree80664db14a94a7d3ed5047f87f25a16b46470934 /src/newt/classes/com/jogamp
parenta349db5086a7be7dd80fc2ad29a8a4b55f343e01 (diff)
Fix SWTEDTUtil Bug628: Perform NEWT event dispatching on SWT-EDT, due to possible triggered locking action, i.e. display(). Do the same for AWTEDTUtil.
This fix actually clarifies the annotated FIXME :)
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/swt/SWTEDTUtil.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/newt/classes/com/jogamp/newt/swt/SWTEDTUtil.java b/src/newt/classes/com/jogamp/newt/swt/SWTEDTUtil.java
index d4b83d891..d40aa18cf 100644
--- a/src/newt/classes/com/jogamp/newt/swt/SWTEDTUtil.java
+++ b/src/newt/classes/com/jogamp/newt/swt/SWTEDTUtil.java
@@ -231,12 +231,15 @@ public class SWTEDTUtil implements EDTUtil {
do {
// event dispatch
if(!shouldStop) {
- // FIXME: Determine whether we require to run the
- // delivery of events (dispatch) on AWT-EDT.
- // Since the WindowDriver itself delivers all Window related events,
- // this shall not be required.
- // AWTEDTExecutor.singleton.invoke(true, dispatchMessages);
- dispatchMessages.run();
+ // EDT invoke thread is SWT-EDT,
+ // hence dispatching is required to run on SWT-EDT as well.
+ // Otherwise a deadlock may happen due to dispatched event's
+ // triggering a locking action.
+ if ( !swtDisplay.isDisposed() ) {
+ swtDisplay.syncExec(dispatchMessages);
+ } else {
+ dispatchMessages.run();
+ }
}
// wait
synchronized(sync) {