| Summary: | Display.ayncExec(null) does not cause readAndDispatch() to return true. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Silenio Quarti <Silenio_Quarti> | ||||
| Component: | SWT | Assignee: | Silenio Quarti <Silenio_Quarti> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | markus.kell.r | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | 3.7 M7 | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 193840 [details]
fix
Fixed > 20110421. |
Run this snippet and stop moving the mouse or typing. On all platforms but cocoa, you get a sequence like this printed to the console. loop=true loop=false loop=true loop=false import org.eclipse.swt.widgets.*; public class SyncThread { public static void main(String[] args) { final Display display = new Display(); Shell shell = new Shell(display); new Thread() { public void run() { while (!display.isDisposed()) { //1 // display.asyncExec(new Runnable() { // public void run() { // } // }); //2 display.asyncExec(null); //3 // display.wake(); try { Thread.sleep(500); } catch (Throwable e) {} } } }.start(); shell.pack(); shell.open(); while (!shell.isDisposed()) { boolean events = display.readAndDispatch(); System.out.println("loop=" + events); if (!events) display.sleep(); } display.dispose(); } }