changeset 4367:e60cfd711532

6901021: Security Warning Icon not getting displayed properly when frame loses focus Summary: Make sure the gray icon is selected when hiding the security warning Reviewed-by: art, dcherepanov
author anthony
date Wed, 02 Dec 2009 14:51:39 +0300
parents 4446f3b8a9b4
children 84218580baac
files jdk/src/windows/native/sun/windows/awt_Toolkit.cpp jdk/src/windows/native/sun/windows/awt_Window.cpp
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp	Fri Nov 27 16:07:32 2009 +0300
+++ b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp	Wed Dec 02 14:51:39 2009 +0300
@@ -1518,6 +1518,7 @@
     return defaultIconSm;
 }
 
+// The icon at index 0 must be gray. See AwtWindow::GetSecurityWarningIcon()
 HICON AwtToolkit::GetSecurityWarningIcon(UINT index, UINT w, UINT h)
 {
     //Note: should not exceed 10 because of the current implementation.
--- a/jdk/src/windows/native/sun/windows/awt_Window.cpp	Fri Nov 27 16:07:32 2009 +0300
+++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp	Wed Dec 02 14:51:39 2009 +0300
@@ -652,7 +652,10 @@
 
 HICON AwtWindow::GetSecurityWarningIcon()
 {
-    HICON ico = AwtToolkit::GetInstance().GetSecurityWarningIcon(securityWarningAnimationStage,
+    // It is assumed that the icon at index 0 is gray
+    const UINT index = securityAnimationKind == akShow ?
+        securityWarningAnimationStage : 0;
+    HICON ico = AwtToolkit::GetInstance().GetSecurityWarningIcon(index,
             warningWindowWidth, warningWindowHeight);
     return ico;
 }