--- old/src/java.desktop/unix/classes/sun/awt/X11/XTrayIconPeer.java 2016-04-11 20:58:31.630669455 +0530 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XTrayIconPeer.java 2016-04-11 20:58:31.450669455 +0530 @@ -464,7 +464,7 @@ XToolkit.postEvent(XToolkit.targetToAppContext(e.getSource()), e); } public void mouseClicked(MouseEvent e) { - if ((e.getClickCount() > 1 || xtiPeer.balloon.isVisible()) && + if ((e.getClickCount() == 1 || xtiPeer.balloon.isVisible()) && e.getButton() == MouseEvent.BUTTON1) { ActionEvent aev = new ActionEvent(xtiPeer.target, ActionEvent.ACTION_PERFORMED, --- old/test/java/awt/TrayIcon/TrayIconMouseTest/TrayIconMouseTest.java 2016-04-11 20:58:32.194669455 +0530 +++ new/test/java/awt/TrayIcon/TrayIconMouseTest/TrayIconMouseTest.java 2016-04-11 20:58:31.986669455 +0530 @@ -27,8 +27,10 @@ /* * @test + * @bug 6384991 * @summary Check if ActionEvent is triggered by a TrayIcon only when - * it is double clicked using mouse button 1 (or single clicked + * it is double clicked on windows & single clicked on unix + * using mouse button 1 (or single clicked * with button 3 (on Mac OS X)) * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com) * @library ../../../../lib/testlibrary ../ @@ -44,6 +46,7 @@ boolean actionPerformed = false; Object actionLock = new Object(); static boolean isMacOS = false; + static boolean isWinOS = false; String caption = "Sample Icon"; @@ -64,8 +67,11 @@ System.out.println("SystemTray not supported on the platform under test. " + "Marking the test passed"); } else { - if (System.getProperty("os.name").toLowerCase().startsWith("mac")) { + String osName = System.getProperty("os.name").toLowerCase(); + if (osName.startsWith("mac")) { isMacOS = true; + } else if (osName.startsWith("win")) { + isWinOS = true; } else if (SystemTrayIconHelper.isOel7()) { System.out.println("OEL 7 doesn't support double click in " + "systray. Skipped"); @@ -119,7 +125,7 @@ }else if (isMacOS && i == 2) { throw new RuntimeException("FAIL: ActionEvent NOT triggered when " + buttonNames[i] + " is single clicked on Mac OS"); - }else if (actionPerformed) { + } else if (actionPerformed && isWinOS) { throw new RuntimeException("FAIL: ActionEvent triggered when " + buttonNames[i] + " is single clicked"); } @@ -137,7 +143,7 @@ robot.waitForIdle(); - if (actionPerformed) + if (actionPerformed && isWinOS) throw new RuntimeException("FAIL: ActionEvent triggered when " + buttonNames[i] + " and " + buttonNames[j] + " is clicked and released");