From ce232e8248d8a7dea65838e180a10ab197890ab6 Mon Sep 17 00:00:00 2001 From: ant Date: Wed, 19 Mar 2008 16:23:50 +0300 Subject: [PATCH] 6567410: PIT : java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java fails Summary: A filter flag has been added to the HCBT focus hook. Reviewed-by: dcherepanov --- src/windows/native/sun/windows/awt_Window.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/windows/native/sun/windows/awt_Window.cpp b/src/windows/native/sun/windows/awt_Window.cpp index eda6e178c..7e2f31fb1 100644 --- a/src/windows/native/sun/windows/awt_Window.cpp +++ b/src/windows/native/sun/windows/awt_Window.cpp @@ -334,8 +334,11 @@ 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()) { - return 1; // Don't change focus/activation. + 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); -- GitLab