How to detect when Eclipse is not the foreground application? [message #326294] |
Thu, 13 March 2008 21:37 |
Eclipse User |
|
|
|
Originally posted by: mark_melvin.amis.com
Hi There,
I posted to the SWT newsgroup, but this may be an Eclipse question. I
have an "always-on-top" shell that I want to "go away" whenever Eclipse is
not in the foreground, or is minimized. I can't for the life of me get
this to work. Is there any way to be notified when Eclipse is sent to the
back or iconified, and vice-versa, so I can toggle the visibility of my
shell? Otherwise my shell is always on top, even when Eclipse is
minimized and I am working in another application.
I had mild and sporadic success listening to SWT.Activate/SWT.Deactivate
events on the active workbench window's shell, but it seems to depend on
what the workbench gives you back as the active workbench window. I can't
find a way to get Eclipse's "top-level" shell so I can tell if the Eclipse
application is actually hidden or visible.
Thanks in advance for any help,
Mark.
|
|
|
Re: How to detect when Eclipse is not the foreground application? [message #326315 is a reply to message #326294] |
Fri, 14 March 2008 14:40 |
Eclipse User |
|
|
|
Originally posted by: mark_melvin.amis.com
FYI - I solved my problem by using SWT.TOOL style instead of SWT.ON_TOP,
using the display's active Shell as a parent (instead of the display), and
using a non-null active shell when re-creating my shell (DOH!). Now it
seems to work exactly how I want it to.
Thanks,
Mark.
On Thu, 13 Mar 2008 17:37:08 -0400, Mark Melvin <mark_melvin@amis.com>
wrote:
> Hi There,
>
> I posted to the SWT newsgroup, but this may be an Eclipse question. I
> have an "always-on-top" shell that I want to "go away" whenever Eclipse
> is not in the foreground, or is minimized. I can't for the life of me
> get this to work. Is there any way to be notified when Eclipse is sent
> to the back or iconified, and vice-versa, so I can toggle the visibility
> of my shell? Otherwise my shell is always on top, even when Eclipse is
> minimized and I am working in another application.
>
> I had mild and sporadic success listening to SWT.Activate/SWT.Deactivate
> events on the active workbench window's shell, but it seems to depend on
> what the workbench gives you back as the active workbench window. I
> can't find a way to get Eclipse's "top-level" shell so I can tell if the
> Eclipse application is actually hidden or visible.
>
> Thanks in advance for any help,
> Mark.
|
|
|
Powered by
FUDForum. Page generated in 0.03354 seconds