diff options
author | Silenio Quarti <silenio> | 2004-10-08 20:19:05 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2004-10-08 20:19:05 +0000 |
commit | 5b2c951e7c4ab1cad8672d53227193a151c54df6 (patch) | |
tree | 595e58830159731d79d166fa6835a6e8854b18c6 /bundles | |
parent | 8dc10e489fc130b2c1925f90b31b21e7d55d153c (diff) | |
download | eclipse.platform.swt-5b2c951e7c4ab1cad8672d53227193a151c54df6.tar.gz eclipse.platform.swt-5b2c951e7c4ab1cad8672d53227193a151c54df6.tar.xz eclipse.platform.swt-5b2c951e7c4ab1cad8672d53227193a151c54df6.zip |
*** empty log message ***
Diffstat (limited to 'bundles')
2 files changed, 31 insertions, 25 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGeneratorAppUI.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGeneratorAppUI.java index 35891c9b37..476cac5b31 100644 --- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGeneratorAppUI.java +++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGeneratorAppUI.java @@ -155,7 +155,7 @@ void generateAll() { Control child = children[i]; if (child instanceof Button) child.setEnabled(false); } - final boolean showProgress = false; + final boolean showProgress = true; if (showProgress) { progressLabel.setText(""); progressBar.setSelection(0); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java index f2cc390b70..ad3dba118d 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java @@ -2630,18 +2630,7 @@ public boolean readAndDispatch () { checkDevice (); int xtContext = OS.XtDisplayToApplicationContext (xDisplay); int status = OS.XtAppPending (xtContext); - if (status == 0) { - if (getMessageCount () == 0) { - /* - * Force Xt work procs that were added by native - * widgets to run by calling XtAppProcessEvent(). - * Ensure that XtAppProcessEvent() does not block - * by adding a time out. - */ - OS.XtAppAddTimeOut (xtContext, 1, 0, 0); - OS.XtAppProcessEvent (xtContext, OS.XtIMTimer); - } - } else { + if (status != 0) { if ((status & OS.XtIMTimer) != 0) { OS.XtAppProcessEvent (xtContext, OS.XtIMTimer); status = OS.XtAppPending (xtContext); @@ -3277,21 +3266,26 @@ public boolean sleep () { /* * This code is intentionally commented. */ +// boolean result; // int xtContext = OS.XtDisplayToApplicationContext (xDisplay); -// /* -// * Bug in Xt. Under certain circumstances Xt waits -// * forever looking for X events, ignoring alternate -// * inputs. The fix is to never sleep forever. -// */ -// int sleepID = OS.XtAppAddTimeOut (xtContext, 100, 0, 0); -// boolean result = OS.XtAppPeekEvent (xtContext, xEvent); -// if (sleepID != 0) OS.XtRemoveTimeOut (sleepID); +// do { +// /* +// * Bug in Xt. Under certain circumstances Xt waits +// * forever looking for X events, ignoring alternate +// * inputs. The fix is to never sleep forever. +// */ +// //int sleepID = OS.XtAppAddTimeOut (xtContext, 50, 0, 0); +// result = OS.XtAppPeekEvent (xtContext, xEvent); +// //if (sleepID != 0) OS.XtRemoveTimeOut (sleepID); +// } while (!result && getMessageCount () == 0 && OS.XtAppPending (xtContext) == 0); // return result; - - int result; + + /* Wait for input */ + int result, status; + boolean workProc = true; int display_fd = OS.ConnectionNumber (xDisplay); - int max_fd = display_fd > read_fd ? display_fd : read_fd; int xtContext = OS.XtDisplayToApplicationContext (xDisplay); + int max_fd = display_fd > read_fd ? display_fd : read_fd; do { OS.FD_ZERO (fd_set); OS.FD_SET (display_fd, fd_set); @@ -3314,7 +3308,19 @@ public boolean sleep () { } } } - } while (result == 0 && OS.XtAppPending (xtContext) == 0 && getMessageCount () == 0); + /* + * Force Xt work procs that were added by native + * widgets to run by calling XtAppProcessEvent(). + * Ensure that XtAppProcessEvent() does not block + * by adding a time out. + */ + status = OS.XtAppPending (xtContext); + if (workProc && status == 0) { + workProc = false; + OS.XtAppAddTimeOut (xtContext, 1, 0, 0); + OS.XtAppProcessEvent (xtContext, OS.XtIMTimer); + } + } while (result == 0 && getMessageCount () == 0 && status == 0); return OS.FD_ISSET (display_fd, fd_set); } /** |