Conversation
…row dropFilepaths dynamically like glfw
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SDL platform allocates 1024 filepaths when user drag/drops file ontop of the Window. Why was it done this way? I don't know, I tried to find where this limit was specified in raylibs config and couldn't!
It turns out GLFW platform layer does not even enforce an arbitrary 1024 limit! It just grows it as needed.
https://github.com/jestarray/raylib/blob/master/src/platforms/rcore_desktop_glfw.c#L2066
(Interestingly the GLFW platform layer also clears the previous dropFilePaths but that should be discussed in another issue. The GLFW one technically shouldn't clear the old dropped paths)
This PR aligns the SDL platform layer behavior closer to GLFW in that just grow the paths dynamically, which simplifies the code a lot because it removes the weird 1024 initial allocation, and a limitation that isn't really defined anywhere else. Either way, user dragging a file ontop of window is a very infrequent and rare usecase and is unlikely to be the source of problems if we let it grow unbounded(people have to clear with
UnloadDroppedFilesthemselves anyways)