提交 87c6e016 编写于 作者: A anthony

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
上级 b22912af
...@@ -220,6 +220,7 @@ AwtWindow::AwtWindow() { ...@@ -220,6 +220,7 @@ AwtWindow::AwtWindow() {
::InitializeCriticalSection(&contentBitmapCS); ::InitializeCriticalSection(&contentBitmapCS);
m_windowType = Type::NORMAL; m_windowType = Type::NORMAL;
m_alwaysOnTop = false;
} }
AwtWindow::~AwtWindow() AwtWindow::~AwtWindow()
...@@ -352,10 +353,10 @@ void AwtWindow::RepositionSecurityWarning(JNIEnv *env) ...@@ -352,10 +353,10 @@ void AwtWindow::RepositionSecurityWarning(JNIEnv *env)
RECT rect; RECT rect;
CalculateWarningWindowBounds(env, &rect); CalculateWarningWindowBounds(env, &rect);
::SetWindowPos(warningWindow, HWND_NOTOPMOST, ::SetWindowPos(warningWindow, IsAlwaysOnTop() ? HWND_TOPMOST : GetHWnd(),
rect.left, rect.top, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top, rect.right - rect.left, rect.bottom - rect.top,
SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOZORDER | SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE |
SWP_NOOWNERZORDER SWP_NOOWNERZORDER
); );
} }
...@@ -831,7 +832,9 @@ void AwtWindow::StartSecurityAnimation(AnimationKind kind) ...@@ -831,7 +832,9 @@ void AwtWindow::StartSecurityAnimation(AnimationKind kind)
securityAnimationTimerElapse, NULL); securityAnimationTimerElapse, NULL);
if (securityAnimationKind == akShow) { 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_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE |
SWP_SHOWWINDOW | SWP_NOOWNERZORDER); SWP_SHOWWINDOW | SWP_NOOWNERZORDER);
...@@ -2270,6 +2273,7 @@ void AwtWindow::_SetAlwaysOnTop(void *param) ...@@ -2270,6 +2273,7 @@ void AwtWindow::_SetAlwaysOnTop(void *param)
if (::IsWindow(w->GetHWnd())) if (::IsWindow(w->GetHWnd()))
{ {
w->SendMessage(WM_AWT_SETALWAYSONTOP, (WPARAM)value, (LPARAM)w); w->SendMessage(WM_AWT_SETALWAYSONTOP, (WPARAM)value, (LPARAM)w);
w->m_alwaysOnTop = (bool)value;
} }
ret: ret:
env->DeleteGlobalRef(self); env->DeleteGlobalRef(self);
......
...@@ -383,6 +383,10 @@ private: ...@@ -383,6 +383,10 @@ private:
// Tweak the style according to the type of the window // Tweak the style according to the type of the window
void TweakStyle(DWORD & style, DWORD & exStyle); void TweakStyle(DWORD & style, DWORD & exStyle);
// Set in _SetAlwaysOnTop()
bool m_alwaysOnTop;
public:
inline bool IsAlwaysOnTop() { return m_alwaysOnTop; }
}; };
#endif /* AWT_WINDOW_H */ #endif /* AWT_WINDOW_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册