Skip to main content

Feedback on SystemTray support in b38

5 replies [Last post]
cowwoc
Offline
Joined: 2003-08-24

I scanned the code quickly without actually trying to run a testcase and I am fairly satisfied with it. The implementation and comments are definately much cleaner than the original JDIC version. (Good job guys!)

There are two things I wanted to check for (by actually running it):

1) When one right-clicks on the icon, does the popup menu overlap the taskbar? Looking at the code, it looks like the answer is yes.

2) When one attempts to shutdown the application by disposing all threads except the AWT one (which in theory, handles the tray icons as well) does the application properly shut down or do the icons use a non-deamon thread?

3) How does one differentiate between balloon popup menus versus simple captions in Windows XP? Can one control which one is used? (Looking at the code, the answer is probably no) Which one is currently used by default under WinXP?

Anyway, I will eventually get around to running a testcase (too busy right now) to check on these things. If anyone gets around to it before me please try answering my questions.

Thanks,
Gili

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
anton_t
Offline
Joined: 2005-06-03

Cowwoc, thank you for the feedback. Here are answers to
your questions:

> 1) When one right-clicks on the icon, does the popup
> menu overlap the taskbar? Looking at the code, it looks
> like the answer is yes.

As a popup menu we use real java.awt.PopupMenu (even when it's shown), not java.awt.Window. So, the answer is yes.

> 2) When one attempts to shutdown the application by
> disposing all threads except the AWT one (which in
> theory, handles the tray icons as well) does the
> application properly shut down or do the icons use a
> non-deamon thread?

TrayIcon doesn't use non-daemon threads. It's correct way
to shutdown the app along with a TrayIcon.

> 3) How does one differentiate between balloon popup
> menus versus simple captions in Windows XP? Can one
> control which one is used? (Looking at the code, the
> answer is probably no) Which one is currently used by
> default under WinXP?

On Windows balloon (displayMessage) and tooltip (setToolTip) messages are native. It'll be quite difficult
to mix them =)

> What operating systems are currently supported? From
> the code, it looks like we only support Windows 2000
> and up on the windows-end. Any plans to backport
> further (I don't really care about older support, I'm
> just wondering).

WinXP is supported either.

Regarding your questions about color depth changing.
TrayIcon on Windows uses native resources and is displayed
as a native Windows tray icon in the Status Area.
And so, Windows works with the color on it's own.

Hope it helps and thanks again.

cowwoc
Offline
Joined: 2003-08-24

What about my last question: we need to be able to find out whether the balloon was dismissed due to:

1) Use clicked on its body
2) Use clicked on its X (close) button
3) Timeout occured and balloon dismissed itself

Depending on the reason, my application will trigger a different behavior. For example, clicking on the body might cause by application to un-minimize itself.

Gili

anton_t
Offline
Joined: 2005-06-03

Oh, sorry, I missed that question.

When user clicks on the balloon's body an ActionEvent
is triggered. When user clicks on "X" button it's just
closed. This will be reflected in the javadoc, it's
going to be updated soon for SystemTray API (something
was missed, unfortunately).

Anton.

cowwoc
Offline
Joined: 2003-08-24

I just remembered a few more important questions I had:

- What happens if I have a 32-bit Icon and Windows is running in 16-bit mode and I try setting this as an Icon? Do you make sure to downsample the icon before setting it? I think you need to.

- What happens if I set a 16-bit icon when the desktop is in 16-bit mode and then the user changes to 32-bit color depth. I'm guessing my old 16-bit icon will look really ugly. I know other native applications deal with this problem (upgrade to a 32-bit icon on demand) but it doesn't look like our code does this. Should I open up a RFE?

- What operating systems are currently supported? From the code, it looks like we only support Windows 2000 and up on the windows-end. Any plans to backport further (I don't really care about older support, I'm just wondering).

cowwoc
Offline
Joined: 2003-08-24

Another thing which seems to be missing from the API is that I should be able to distinguish between the balloon popup getting dismissed due to a timeout or due to the user clicking on it.