summaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
authorAlvin Wong <alvinhochun@gmail.com>2024-08-15 04:07:08 +0800
committerAlvin Wong <alvinhochun@gmail.com>2024-08-15 04:10:15 +0800
commit16a563b9ac476114760d05f6359e843621225c67 (patch)
treed426c7ba069a9198718bab07f1be7b8876be7844 /platform
parent8e666adeed99328fda02e47429c8e45f36cd5ae1 (diff)
downloadredot-engine-16a563b9ac476114760d05f6359e843621225c67.tar.gz
DisplayServerWindows: Fix logic when creating with transient parent
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/display_server_windows.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 7e368b4c1e..88ab9a4af0 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -5391,13 +5391,15 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode,
{
WindowData *wd_transient_parent = nullptr;
HWND owner_hwnd = nullptr;
- if (p_transient_parent != INVALID_WINDOW_ID && !windows.has(p_transient_parent)) {
- ERR_PRINT("Condition \"!windows.has(p_transient_parent)\" is true.");
- p_transient_parent = INVALID_WINDOW_ID;
- } else {
- wd_transient_parent = &windows[p_transient_parent];
- if (p_exclusive) {
- owner_hwnd = wd_transient_parent->hWnd;
+ if (p_transient_parent != INVALID_WINDOW_ID) {
+ if (!windows.has(p_transient_parent)) {
+ ERR_PRINT("Condition \"!windows.has(p_transient_parent)\" is true.");
+ p_transient_parent = INVALID_WINDOW_ID;
+ } else {
+ wd_transient_parent = &windows[p_transient_parent];
+ if (p_exclusive) {
+ owner_hwnd = wd_transient_parent->hWnd;
+ }
}
}