Merge pull request #95526 from alvinhochun/fix-pr94706

DisplayServerWindows: Fix logic when creating with transient parent
This commit is contained in:
Rémi Verschelde 2024-08-15 00:43:24 +02:00 committed by GitHub
commit f27724e902
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5391,13 +5391,15 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode,
{ {
WindowData *wd_transient_parent = nullptr; WindowData *wd_transient_parent = nullptr;
HWND owner_hwnd = nullptr; HWND owner_hwnd = nullptr;
if (p_transient_parent != INVALID_WINDOW_ID && !windows.has(p_transient_parent)) { if (p_transient_parent != INVALID_WINDOW_ID) {
ERR_PRINT("Condition \"!windows.has(p_transient_parent)\" is true."); if (!windows.has(p_transient_parent)) {
p_transient_parent = INVALID_WINDOW_ID; ERR_PRINT("Condition \"!windows.has(p_transient_parent)\" is true.");
} else { p_transient_parent = INVALID_WINDOW_ID;
wd_transient_parent = &windows[p_transient_parent]; } else {
if (p_exclusive) { wd_transient_parent = &windows[p_transient_parent];
owner_hwnd = wd_transient_parent->hWnd; if (p_exclusive) {
owner_hwnd = wd_transient_parent->hWnd;
}
} }
} }