6900622: Security warning icon is not getting displayed properly for tooltip
authoranthony
Wed, 09 Dec 2009 14:02:48 +0300
changeset 4375 dc92e241ccea
parent 4374 f672d9cf521e
child 4376 61cb05d6efa2
6900622: Security warning icon is not getting displayed properly for tooltip Summary: Pass a correct value for the hWndInsertAfter argument to the ::SetWindowPos() function Reviewed-by: art, dcherepanov
jdk/src/windows/native/sun/windows/awt_Window.cpp
jdk/src/windows/native/sun/windows/awt_Window.h
--- a/jdk/src/windows/native/sun/windows/awt_Window.cpp	Tue Dec 08 09:02:09 2009 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp	Wed Dec 09 14:02:48 2009 +0300
@@ -220,6 +220,7 @@
     ::InitializeCriticalSection(&contentBitmapCS);
 
     m_windowType = Type::NORMAL;
+    m_alwaysOnTop = false;
 }
 
 AwtWindow::~AwtWindow()
@@ -352,10 +353,10 @@
     RECT rect;
     CalculateWarningWindowBounds(env, &rect);
 
-    ::SetWindowPos(warningWindow, HWND_NOTOPMOST,
+    ::SetWindowPos(warningWindow, IsAlwaysOnTop() ? HWND_TOPMOST : GetHWnd(),
             rect.left, rect.top,
             rect.right - rect.left, rect.bottom - rect.top,
-            SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOZORDER |
+            SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE |
             SWP_NOOWNERZORDER
             );
 }
@@ -831,7 +832,9 @@
             securityAnimationTimerElapse, NULL);
 
     if (securityAnimationKind == akShow) {
-        ::SetWindowPos(warningWindow, HWND_NOTOPMOST, 0, 0, 0, 0,
+        ::SetWindowPos(warningWindow,
+                IsAlwaysOnTop() ? HWND_TOPMOST : GetHWnd(),
+                0, 0, 0, 0,
                 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE |
                 SWP_SHOWWINDOW | SWP_NOOWNERZORDER);
 
@@ -2270,6 +2273,7 @@
     if (::IsWindow(w->GetHWnd()))
     {
         w->SendMessage(WM_AWT_SETALWAYSONTOP, (WPARAM)value, (LPARAM)w);
+        w->m_alwaysOnTop = (bool)value;
     }
 ret:
     env->DeleteGlobalRef(self);
--- a/jdk/src/windows/native/sun/windows/awt_Window.h	Tue Dec 08 09:02:09 2009 -0800
+++ b/jdk/src/windows/native/sun/windows/awt_Window.h	Wed Dec 09 14:02:48 2009 +0300
@@ -383,6 +383,10 @@
     // Tweak the style according to the type of the window
     void TweakStyle(DWORD & style, DWORD & exStyle);
 
+    // Set in _SetAlwaysOnTop()
+    bool m_alwaysOnTop;
+public:
+    inline bool IsAlwaysOnTop() { return m_alwaysOnTop; }
 };
 
 #endif /* AWT_WINDOW_H */