Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 21382

Summary: [Dialogs] Java Build Path properties page freezes UI during compile [general issue]
Product: [Eclipse Project] Platform Reporter: Adam Schlegel <Adam_Schlegel>
Component: UIAssignee: Tod Creasey <Tod_Creasey>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dirk_baeumer, lavinm
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Adam Schlegel CLA 2002-07-08 16:15:31 EDT
Build 2.0 release

When a change is made on the Java Build Path peroperty page, and the user clicks
on OK, the progress monitor is opened while the current project compiles.
However, the compile is run in the UI thread, so the UI is unresponsive during
the compile.

Windows appears to handle the case rather well, since changes to the dialog's
messages are displayed on screen. However, Linux GTK does not fare as well. The
compile displays as a completely blank progress monitor (the progress indicator
does work however).

The offending code appears to be in BuildPathsPropertyPage.performOK where
ProgressMonitorDialog.run is called with fork=false.
Comment 1 Dirk Baeumer CLA 2002-07-29 05:46:33 EDT
If Linux GTK needs an "active" event loop to process repaints then we have the 
same problem in all places where we start a modal context operation with 
fork=false.

Moving to SWT for commenting if this is the case. If so then somebody 
(workbench/SWT) must provide support for updating a label even in cases where 
fork=false. There are cases where we pass fork=false on purpose and changing 
this isn't easy.
Comment 2 Steve Northover CLA 2002-08-06 15:12:00 EDT
Exactly when a widget redraws is undefined.  On some platforms, changing the 
text of a label redraws right away.  On others, a "paint event" is queued.

In order for an application to ensure that all outstanding paints for a widget 
are serviced right away without falling back to an event loop, use 
Control.update().

NOTE:  It's generally a bad idea to force repaints in the UI.  This can lead to 
flickering because forcing a paint defeats the paint merging mechanism that is 
native on most operating systems.

In this case, Control.update() seems to be exactly what you need.  Feel free to 
reopen this PR if this doesn't work for you.
Comment 3 Dirk Baeumer CLA 2002-08-09 10:46:01 EDT
Control.update() is exactly what we need. Reopeing PR and moving to platform 
since we are using platform componentes to present progress.
Comment 4 Tod Creasey CLA 2002-09-17 16:14:23 EDT
Fixed in build >20020918
Comment 5 Tod Creasey CLA 2002-09-17 16:15:53 EDT
*** Bug 22733 has been marked as a duplicate of this bug. ***
Comment 6 Tod Creasey CLA 2005-05-10 14:56:17 EDT
Marking closed