Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ptziegler opened this issue Oct 31, 2024 · 0 comments
Open
Labels
good first issue Good for newcomers

Comments

@ptziegler
Copy link
Contributor

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.

@ptziegler ptziegler added the good first issue Good for newcomers label Oct 31, 2024
@ptziegler ptziegler changed the title Corrupt progress monitor when switching to design page on Linux Corrupt progress monitor dialog when switching to design page on Linux Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant