Progress Monitor freezes when app loses focus [message #501099] |
Mon, 30 November 2009 22:04  |
Eclipse User |
|
|
|
I am trying to use a progress monitor in an RCP application. I have a menu action that is invoke from the menubar and in the action's run() method, creates a wizard dialog and calls the dialog's .open() method. In the performFinish() method of the dialog, I am creating an IRunnableWithProgress object and invoking it with a getContainer(false, false, operation) method call, where the operation is the IRunnableWithProgress. Everything works fine with the progress bar, but if I click on another application, and then click back on the RCP application, the RCP app and wizard dialog both report "Not Responding", and the progress bar stops showing progress. As soon as the operation completes, the dialog disappears, and the app begins responding. I have tried different variations of Jobs, display.async, etc. and nothing seems to make a difference in the behavior. If I do not click on another application, the progress monitor shows progress updates until the operation is complete. It only freezes when I click on anything outside of the RCP app.
|
|
|
Re: Progress Monitor freezes when app loses focus [message #501107 is a reply to message #501099] |
Mon, 30 November 2009 23:39   |
Eclipse User |
|
|
|
Rollie wrote:
> I am trying to use a progress monitor in an RCP application. I have a
> menu action that is invoke from the menubar and in the action's run()
> method, creates a wizard dialog and calls the dialog's .open() method.
> In the performFinish() method of the dialog, I am creating an
> IRunnableWithProgress object and invoking it with a getContainer(false,
> false, operation) method call, where the operation is the
> IRunnableWithProgress. Everything works fine with the progress bar, but
> if I click on another application, and then click back on the RCP
> application, the RCP app and wizard dialog both report "Not Responding",
> and the progress bar stops showing progress. As soon as the operation
> completes, the dialog disappears, and the app begins responding. I have
> tried different variations of Jobs, display.async, etc. and nothing
> seems to make a difference in the behavior. If I do not click on
> another application, the progress monitor shows progress updates until
> the operation is complete. It only freezes when I click on anything
> outside of the RCP app.
> IRunnableWithProgress object and invoking it with a
> getContainer(false, false, operation) method call,
When you say false for the first argument, the operation is run on the
same thread as the invoking thread. You are probably invoking it in the
UI thread, which results in the UI freeze
- Prakash Platform UI Team, IBM
Blog <http://blog.eclipse-tips.com>
Twitter <http://www.twitter.com/Eclipse_Tips>
|
|
|
Re: Progress Monitor freezes when app loses focus [message #501112 is a reply to message #501107] |
Tue, 01 December 2009 00:22  |
Eclipse User |
|
|
|
Thanks for the response Prakash. I had tried passing true for the fork before, but I did not the wizard did not work. After your reply, I tried it again and found that an exception was being thrown that was being caught and discarded which showed that I was trying to access some wizard methods during the runnable. I pulled those calls out into final variables before the runnable, and now the progress bar is working as desired. Thanks again.
|
|
|
Powered by
FUDForum. Page generated in 0.06515 seconds