Skip to content

Fix SDL window and resource destruction calls - #1410

Merged
bryanedds merged 1 commit into
vulkanfrom
split/pr-1392-window-dpi
Aug 2, 2026
Merged

Fix SDL window and resource destruction calls #1410
bryanedds merged 1 commit into
vulkanfrom
split/pr-1392-window-dpi

Conversation

@Happypig375

Copy link
Copy Markdown
Collaborator

Split from #1392

  • Window resizes may cause asynchronous window animations where window syncing is needed.
  • Setting window position may change window pixel density because it may be contained in a new display monitor.
  • Calling SDL's window setters should always divide by pixel density but currently set position multiples it instead.

@bryanedds

Copy link
Copy Markdown
Owner

"Calling SDL's window setters should always divide by pixel density but currently set position multiples it instead."

I don't think it does? -

    let internal trySetWindowSize (size : Vector2i) state =
        match Option.flatten (Option.map SdlDeps.getWindowOpt state.SdlDepsOpt) with
        | Some window ->
            let pixelDensity = SDL3.SDL_GetWindowPixelDensity window
            SDL3.SDL_SetWindowSize (window, int (single size.X / pixelDensity), int (single size.Y / pixelDensity)) |> ignore
        | None -> ()

@Happypig375

Copy link
Copy Markdown
Collaborator Author

@bryanedds You're looking at "set window size" not "set window position".

@bryanedds

Copy link
Copy Markdown
Owner

Ah I see. I'll apply the trySetWindowPosition fix manually for now then come back to this PR when I have time to review it properly.

@bryanedds
bryanedds merged commit c3d80a4 into vulkan Aug 2, 2026
16 checks passed
@bryanedds
bryanedds deleted the split/pr-1392-window-dpi branch August 9, 2026 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants