mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-1257 CommonItemDialog modal window has no owner
Fix modality for Common Item Dialog squash! JBR-1257 CommonItemDialog modal window has no owner JBR-2478 java/awt/Modal/FileDialog/FileDialogNonModal7Test.java: DummyButton on Dialog did not gain focus when clicked revert part of JBR-1271, that's related to 'old' file dialogs
This commit is contained in:
committed by
jbrbot
parent
2eb17e84ee
commit
295987f575
@@ -627,7 +627,14 @@ AwtFileDialog::Show(void *p)
|
||||
}
|
||||
// DASSERT(awtParent);
|
||||
title = (jstring)(env)->GetObjectField(target, AwtDialog::titleID);
|
||||
HWND hwndOwner = awtParent ? awtParent->GetHWnd() : NULL;
|
||||
/*
|
||||
Fix for 6488834.
|
||||
To disable Win32 native parent modality we have to set
|
||||
hwndOwner field to either NULL or some hidden window. For
|
||||
parentless dialogs we use NULL to show them in the taskbar,
|
||||
and for all other dialogs AwtToolkit's HWND is used.
|
||||
*/
|
||||
HWND hwndOwner = awtParent ? AwtToolkit::GetInstance().GetHWnd() : NULL;
|
||||
|
||||
if (title == NULL || env->GetStringLength(title)==0) {
|
||||
title = JNU_NewStringPlatform(env, L" ");
|
||||
@@ -744,7 +751,7 @@ AwtFileDialog::Show(void *p)
|
||||
|
||||
if (useCommonItemDialog && SUCCEEDED(OLE_HR)) {
|
||||
if (mode == java_awt_FileDialog_LOAD) {
|
||||
result = SUCCEEDED(pfd->Show(NULL)) && data.result;
|
||||
result = SUCCEEDED(pfd->Show(hwndOwner)) && data.result;
|
||||
if (!result) {
|
||||
OLE_NEXT_TRY
|
||||
OLE_HRT(pfd->GetResult(&psiResult));
|
||||
@@ -757,7 +764,7 @@ AwtFileDialog::Show(void *p)
|
||||
result = SUCCEEDED(OLE_HR);
|
||||
}
|
||||
} else {
|
||||
result = SUCCEEDED(pfd->Show(NULL));
|
||||
result = SUCCEEDED(pfd->Show(hwndOwner));
|
||||
if (result) {
|
||||
OLE_NEXT_TRY
|
||||
OLE_HRT(pfd->GetResult(&psiResult));
|
||||
|
||||
Reference in New Issue
Block a user