< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_Window.cpp

Print this page

        

@@ -1149,19 +1149,23 @@
 }
 
 void AwtWindow::InitOwner(AwtWindow *owner)
 {
     DASSERT(owner != NULL);
+    AwtWindow *initialOwner = owner;
     while (owner != NULL && owner->IsSimpleWindow()) {
 
         HWND ownerOwnerHWND = ::GetWindow(owner->GetHWnd(), GW_OWNER);
         if (ownerOwnerHWND == NULL) {
             owner = NULL;
             break;
         }
         owner = (AwtWindow *)AwtComponent::GetComponent(ownerOwnerHWND);
     }
+    if (!owner) {
+        owner = initialOwner->GetOwningFrameOrDialog();
+    }
     m_owningFrameDialog = (AwtFrame *)owner;
 }
 
 void AwtWindow::moveToDefaultLocation() {
     HWND boggy = ::CreateWindow(GetClassName(), L"BOGGY", WS_OVERLAPPED, CW_USEDEFAULT, 0 ,0, 0,
< prev index next >