6770457: Using ToolTips causes inactive app window to exhibit active window behavior
Reviewed-by: art, ant
This commit is contained in:
parent
75d9b0f986
commit
76fedc71ad
@ -1843,8 +1843,13 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case WM_AWT_SETALWAYSONTOP: {
|
||||
AwtWindow* w = (AwtWindow*)lParam;
|
||||
BOOL value = (BOOL)wParam;
|
||||
UINT flags = SWP_NOMOVE | SWP_NOSIZE;
|
||||
// transient windows shouldn't change the owner window's position in the z-order
|
||||
if (w->IsRetainingHierarchyZOrder()) {
|
||||
flags |= SWP_NOOWNERZORDER;
|
||||
}
|
||||
::SetWindowPos(w->GetHWnd(), (value != 0 ? HWND_TOPMOST : HWND_NOTOPMOST),
|
||||
0,0,0,0, SWP_NOMOVE|SWP_NOSIZE);
|
||||
0,0,0,0, flags);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,6 @@ jmethodID AwtWindow::calculateSecurityWarningPositionMID;
|
||||
int AwtWindow::ms_instanceCounter = 0;
|
||||
HHOOK AwtWindow::ms_hCBTFilter;
|
||||
AwtWindow * AwtWindow::m_grabbedWindow = NULL;
|
||||
HWND AwtWindow::sm_retainingHierarchyZOrderInShow = NULL;
|
||||
BOOL AwtWindow::sm_resizing = FALSE;
|
||||
UINT AwtWindow::untrustedWindowsCounter = 0;
|
||||
|
||||
@ -341,23 +340,6 @@ MsgRouting AwtWindow::WmNcMouseDown(WPARAM hitTest, int x, int y, int button) {
|
||||
}
|
||||
|
||||
MsgRouting AwtWindow::WmWindowPosChanging(LPARAM windowPos) {
|
||||
/*
|
||||
* See 6178004.
|
||||
* Some windows shouldn't trigger a change in z-order of
|
||||
* any window from the hierarchy.
|
||||
*/
|
||||
if (IsRetainingHierarchyZOrder()) {
|
||||
if (((WINDOWPOS *)windowPos)->flags & SWP_SHOWWINDOW) {
|
||||
sm_retainingHierarchyZOrderInShow = GetHWnd();
|
||||
}
|
||||
} else if (sm_retainingHierarchyZOrderInShow != NULL) {
|
||||
HWND ancestor = ::GetAncestor(sm_retainingHierarchyZOrderInShow, GA_ROOTOWNER);
|
||||
HWND windowAncestor = ::GetAncestor(GetHWnd(), GA_ROOTOWNER);
|
||||
|
||||
if (windowAncestor == ancestor) {
|
||||
((WINDOWPOS *)windowPos)->flags |= SWP_NOZORDER;
|
||||
}
|
||||
}
|
||||
return mrDoDefault;
|
||||
}
|
||||
|
||||
@ -377,12 +359,6 @@ void AwtWindow::RepositionSecurityWarning(JNIEnv *env)
|
||||
MsgRouting AwtWindow::WmWindowPosChanged(LPARAM windowPos) {
|
||||
WINDOWPOS * wp = (WINDOWPOS *)windowPos;
|
||||
|
||||
if (IsRetainingHierarchyZOrder() && wp->flags & SWP_SHOWWINDOW) {
|
||||
// By this time all the windows from the hierarchy are already notified about z-order change.
|
||||
// Thus we may and we should reset the trigger in order not to affect other changes.
|
||||
sm_retainingHierarchyZOrderInShow = NULL;
|
||||
}
|
||||
|
||||
// Reposition the warning window
|
||||
if (IsUntrusted() && warningWindow != NULL) {
|
||||
if (wp->flags & SWP_HIDEWINDOW) {
|
||||
@ -1251,8 +1227,17 @@ void AwtWindow::Show()
|
||||
}
|
||||
}
|
||||
if (!done) {
|
||||
// transient windows shouldn't change the owner window's position in the z-order
|
||||
if (IsRetainingHierarchyZOrder()){
|
||||
UINT flags = SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER;
|
||||
if (nCmdShow == SW_SHOWNA) {
|
||||
flags |= SWP_NOACTIVATE;
|
||||
}
|
||||
::SetWindowPos(GetHWnd(), HWND_TOPMOST, 0, 0, 0, 0, flags);
|
||||
} else {
|
||||
::ShowWindow(GetHWnd(), nCmdShow);
|
||||
}
|
||||
}
|
||||
env->DeleteLocalRef(target);
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,6 @@ private:
|
||||
static int ms_instanceCounter;
|
||||
static HHOOK ms_hCBTFilter;
|
||||
static LRESULT CALLBACK CBTFilter(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
static HWND sm_retainingHierarchyZOrderInShow; // a referred window in the process of show
|
||||
static BOOL sm_resizing; /* in the middle of a resizing operation */
|
||||
|
||||
RECT m_insets; /* a cache of the insets being used */
|
||||
|
Loading…
Reference in New Issue
Block a user