Skip to content

Commit 9da46bc

Browse files
committedApr 16, 2025·
win32: Check internal data when positioning child windows
Under certain circumstances, processing events may try to position a child before it is fully initialized. Check the internal data before proceeding.
1 parent 90fd2a3 commit 9da46bc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/video/windows/SDL_windowswindow.c

+4
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@ bool WIN_SetWindowPositionInternal(SDL_Window *window, UINT flags, SDL_WindowRec
376376

377377
// Update any child windows
378378
for (child_window = window->first_child; child_window; child_window = child_window->next_sibling) {
379+
if (!child_window->internal) {
380+
// This child window is not yet fully initialized.
381+
continue;
382+
}
379383
if (!WIN_SetWindowPositionInternal(child_window, flags, SDL_WINDOWRECT_CURRENT)) {
380384
result = false;
381385
}

0 commit comments

Comments
 (0)
Please sign in to comment.