Skip to content

Commit e58ac37

Browse files
v-einhoffstadt
authored andcommitted
fix (win32): Invoking viewport_resize_callback at the very start (fixes a regression in #2521).
1 parent 034d0cf commit e58ac37

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/mvViewport_win32.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ mvHandleMsg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) noexcept
197197

198198
case WM_SIZE:
199199

200-
if (graphicsData != nullptr && wParam != SIZE_MINIMIZED)
200+
if (wParam != SIZE_MINIMIZED)
201201
{
202202
RECT rect;
203203
RECT crect;
@@ -226,10 +226,13 @@ mvHandleMsg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) noexcept
226226

227227
viewport->resized = true;
228228

229-
if (viewport->decorated)
230-
resize_swapchain(graphics, (int)(UINT)LOWORD(lParam), (int)(UINT)HIWORD(lParam));
231-
else
232-
resize_swapchain(graphics, awidth, aheight);
229+
if (graphicsData != nullptr)
230+
{
231+
if (viewport->decorated)
232+
resize_swapchain(graphics, (int)(UINT)LOWORD(lParam), (int)(UINT)HIWORD(lParam));
233+
else
234+
resize_swapchain(graphics, awidth, aheight);
235+
}
233236
}
234237
return 0;
235238

0 commit comments

Comments
 (0)