From 44e0bda21c99ae211cf72b568e59e5009d420b97 Mon Sep 17 00:00:00 2001 From: Anthony Petrov Date: Wed, 2 Dec 2009 14:51:39 +0300 Subject: [PATCH] 6901021: Security Warning Icon not getting displayed properly when frame loses focus Make sure the gray icon is selected when hiding the security warning Reviewed-by: art, dcherepanov --- jdk/src/windows/native/sun/windows/awt_Toolkit.cpp | 1 + jdk/src/windows/native/sun/windows/awt_Window.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp index b612bd1bf16..9482f358fd1 100644 --- a/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp @@ -1518,6 +1518,7 @@ HICON AwtToolkit::GetAwtIconSm() 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. diff --git a/jdk/src/windows/native/sun/windows/awt_Window.cpp b/jdk/src/windows/native/sun/windows/awt_Window.cpp index c03420d3522..1819115859b 100644 --- a/jdk/src/windows/native/sun/windows/awt_Window.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp @@ -652,7 +652,10 @@ void AwtWindow::UnregisterWarningWindowClass() 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; }