| Summary: | [Progress] Every user-job causes a busy cursor to be shown for a minimum of 250ms | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Markus Schorn <mschorn.eclipse> | ||||||
| Component: | UI | Assignee: | Prakash Rangaraj <prakash> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | Prakash Rangaraj <prakash> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | bokowski, daniel_megert, eclipse, jamesblackburn+eclipse, john.arthorne, mober.at+eclipse, prakash, wb-rel, yevshif | ||||||
| Version: | 3.6 | ||||||||
| Target Milestone: | 3.7 M6 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 339311, 440304 | ||||||||
| Attachments: |
|
||||||||
Created attachment 169491 [details]
Stops the busy cursor when the job is done.
Created attachment 169496 [details]
Improved patch
The job change listener needs to be removed from the job.
Ping, does anybody listen here? We provided a patch for this issue on 21-May and would appreciate a comment. +1, this patch looks good to me. It's a simple and safe fix. The worst case is that someone notifies the UI thread and we don't sleep long enough, but that was a problem in the old code too. In this case you would just get the progress dialog a bit earlier. Prakash, if you can't take this for M6, let me know and I'll take it. Sorry, this slipped off my radar. Will target for 3.7 Patch is good. Released to HEAD Could a backport to 3.6.2+ be considered? It's not top important for us but nice to have. Verified in I20110307-2110 |
When I run a user job ('job.setUser(true)') the UI shows a busy cursor for 250ms, even if the job does not do anything. This becomes apparent when I schedule 20 user-jobs that complete immediately, then the UI shows a busy-cursor for 5 seconds. My expectation is, that the busy cursor is at the maximum shown as long as the job is actually running. Here is a test-case: public class UIJobTest extends TestCase { public void testUIJob() { int count= 20; assertTrue(runEventLoop() < 1000); for (int i=0; i<count; i++) { Job j= new Job("dummy") { @Override protected IStatus run(IProgressMonitor monitor) { return Status.OK_STATUS; } }; j.setUser(true); j.schedule(); } long time = runEventLoop(); assertTrue("Main thread busy for " + time + " ms when runnning " + count + " user jobs.", time < 1000); } private long runEventLoop() { long startTime= System.currentTimeMillis(); Display disp= Display.getCurrent(); assertNotNull(disp); while(disp.readAndDispatch()) { } return System.currentTimeMillis() - startTime; } }