summaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-02-17 13:09:17 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-02-17 13:34:08 +0200
commit0c27667124627559e60e179282bf9988f091c92a (patch)
tree7c7194e9fcd541b93e06aeb7ab1ff486dbb4eb29 /platform
parentb89b1683d4a9d17e2c19021643c27d8d580a70b8 (diff)
downloadredot-engine-0c27667124627559e60e179282bf9988f091c92a.tar.gz
[Windows] Fix Vulkan driver crash on sub-window minimization.
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/display_server_windows.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 2f0b3b4490..41295d41d2 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -2778,13 +2778,14 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
window.width = window_client_rect.size.width;
window.height = window_client_rect.size.height;
-#if defined(VULKAN_ENABLED)
- if (context_vulkan && window_created) {
- context_vulkan->window_resize(window_id, window.width, window.height);
- }
-#endif
rect_changed = true;
}
+#if defined(VULKAN_ENABLED)
+ if (context_vulkan && window_created) {
+ // Note: Trigger resize event to update swapchains when window is minimized/restored, even if size is not changed.
+ context_vulkan->window_resize(window_id, window.width, window.height);
+ }
+#endif
}
if (!window.minimized && (!(window_pos_params->flags & SWP_NOMOVE) || window_pos_params->flags & SWP_FRAMECHANGED)) {