summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/newt/classes/com/jogamp/newt/swt/SWTEDTUtil.java15
-rw-r--r--src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java11
2 files changed, 14 insertions, 12 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) {
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
index 8771f5c74..6fa053dd3 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
@@ -215,12 +215,11 @@ public class AWTEDTUtil 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 AWT-EDT,
+ // hence dispatching is required to run on AWT-EDT as well.
+ // Otherwise a deadlock may happen due to dispatched event's
+ // triggering a locking action.
+ AWTEDTExecutor.singleton.invoke(true, dispatchMessages);
}
// wait
synchronized(sync) {