JDK-6746212 : Broken MouseEvents for TrayIcon
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows,windows_vista
  • CPU: x86
  • Submitted: 2008-09-09
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b48Fixed
Related Reports
Duplicate :  
Relates :  
Description
MouseEvents coming from TrayIcon when using JDK 7 seem to be broken, mouseClicked is not fired. When using JDK 6 everything works as expected - regression?

This can be easily reproduced using example code provided at http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/systemtray (http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/systemtray/SystemTrayExample.zip).

Expected behavior:

When running the example using JDK 6u7, this output is being generated by a single mouse click on a trayicon:

 Tray Icon - Mouse pressed!
 Tray Icon - Mouse released!
 Tray Icon - Mouse clicked!

Actual (incorrect) behavior:

When running the example using JDK 7 b34, this output is being generated by a single mouse click on a trayicon (Mouse clicked is missing):

 Tray Icon - Mouse pressed!
 Tray Icon - Mouse released!


I've also noticed another strange behavior occuring for both JDK 6 and JDK 7 - while a message is displayed for a trayicon (doubleclick in the example), mousePressed event is not fired. This output is being generated by a single mouse click on a trayicon with a message displayed (Mouse pressed is missing):

 Tray Icon - Mouse released!
 Tray Icon - Mouse clicked!

Comments
EVALUATION This must be a typo that were not (and probably can't be) covered with automatic tests: http://sa.sfbay.sun.com/projects/awt_data/7/6430553/src/windows/native/sun/windows/aw t_TrayIcon.cpp.udiff.html We send mouse_click event in the following case: if ((m_mouseButtonClickAllowed & AwtComponent::GetButtonMK(button)) != 1) There should be "!=0" condition indeed.
18-09-2008

EVALUATION this is a regression of the fix for 6430553 that introduces limitations to trigger mouse click events.
09-09-2008