6567410: PIT : java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java fails
authorant
Wed, 19 Mar 2008 16:23:50 +0300
changeset 131 fe5ccd4774b4
parent 129 f995b9c9c5fa
child 132 4d920250c34f
6567410: PIT : java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java fails Summary: A filter flag has been added to the HCBT focus hook. Reviewed-by: dcherepanov
jdk/src/windows/native/sun/windows/awt_Window.cpp
--- a/jdk/src/windows/native/sun/windows/awt_Window.cpp	Tue Mar 18 16:19:03 2008 +0300
+++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp	Wed Mar 19 16:23:50 2008 +0300
@@ -334,8 +334,11 @@
     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);