6567410: PIT : java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java fails

A filter flag has been added to the HCBT focus hook.

Reviewed-by: dcherepanov
This commit is contained in:
Anton Tarasov 2008-03-19 16:23:50 +03:00
parent 723e255938
commit a24634be6b

View File

@ -334,10 +334,13 @@ LRESULT CALLBACK AwtWindow::CBTFilter(int nCode, WPARAM wParam, LPARAM lParam)
if (nCode == HCBT_ACTIVATE || nCode == HCBT_SETFOCUS) {
AwtComponent *comp = AwtComponent::GetComponent((HWND)wParam);
if (comp != NULL && comp->IsTopLevel() && !((AwtWindow*)comp)->IsFocusableWindow()) {
if (comp != NULL && comp->IsTopLevel()) {
AwtWindow* win = (AwtWindow*)comp;
if (!win->IsFocusableWindow() || win->m_filterFocusAndActivation) {
return 1; // Don't change focus/activation.
}
}
}
return ::CallNextHookEx(AwtWindow::ms_hCBTFilter, nCode, wParam, lParam);
}