Skip to content

Corrupt progress monitor dialog when switching to design page on Linux #928

@ptziegler

Description

@ptziegler

The progress monitor that is shown when switching to the Design page is run in the UI thread and therefore blocks the internal refresh of the dialog. The result is as such:

image

We need to investigate what parts of the IRunnableWithProgress need to be run in the UI thread and what can be done in a separate thread. We also needs to make sure that we only switch to the Design page, once the runnable has completed.

IRunnableWithProgress runnable = new IRunnableWithProgress() {
@Override
public void run(final IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
monitor.beginTask("Opening Design page.", 7);
//
try {
DesignPageSite.setProgressMonitor(monitor);
display.syncExec(new Runnable() {
@Override
public void run() {
try {
internal_refreshGEF(monitor);
} catch (Throwable e) {
ReflectionUtils.propagate(e);
}
}
});
} catch (Throwable e) {
ReflectionUtils.propagate(e);
} finally {
DesignPageSite.setProgressMonitor(null);
}
//
monitor.done();
}
};
try {
new ProgressMonitorDialog(DesignerPlugin.getShell()).run(false, false, runnable);

Bonus points if we can remove those dreadful IProgressMonitor methods in the DesignPageSite class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions