Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to detect when Eclipse is not the foreground application?
How to detect when Eclipse is not the foreground application? [message #326294] Thu, 13 March 2008 21:37 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:IFileStore -> IFile
Next Topic:Debugging an Ant task with Eclipse 3.4
Goto Forum:
  


Current Time: Sat Dec 21 12:00:54 GMT 2024

Powered by FUDForum. Page generated in 0.03354 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top