-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: Fix dragging and dropping files from compressed files into editor #97250
Windows: Fix dragging and dropping files from compressed files into editor #97250
Conversation
cba9a5c
to
e8bac6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, and congratulations on your first commit! I tested this and it does appear to work in regards to the issue I raised with 7zip. I'll approve this for now, but would you mind squashing the commits from this PR into a single commit? We generally prefer that convention when merging.
43ceb45
to
99840e9
Compare
Thank you! I have squashed the commits. |
99840e9
to
e7d32cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be working as expected.
Use case described by @Maran23 in #97128 (comment) still doesn't work. I can look into it later.
This likely requires handling CFSTR_FILECONTENTS and CFSTR_FILEDESCRIPTOR in addition to CF_HDROP
.
e7d32cf
to
04140eb
Compare
Added handling of However, this time I had to do a bit of filesystem manipulations and couldn't find some functinality in Godot's source code. These are: joining filepaths with correct OS separator, creating temporary directory with random name, creating all subdirectories for a path and recursively removing directory with it's contents. For now I have written quick & dirty implementations of these, which are not general purpose, but happen to work here. So I would appreciate it if someone pointed me to the relevant existing functionality. Or if it doesn't exist, it probably should be added (maybe in a separate PR?) for general use. |
d8c29b9
to
490832a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally (rebased on top of master
44fa552), it works as expected on Windows 11 23H2. Nested file structures work correctly, and so do file names containing Unicode characters.
Note that empty folders are not created if you drag a folder that contains empty folders to the Godot editor. (Even if you right-click it and use Show in File Manager, the folders won't be there.)
As mentioned in OP, using 7-zip's GUI (7ZFM.exe
) will work, but using Windows Explorer won't. This applies regardless of the compression format.
There's godot/platform/windows/os_windows.cpp Lines 93 to 108 in b3bcb2d
|
490832a
to
2bd7599
Compare
Do we want to wait and try to solve that edge-case, or is this ready to merge now in your eyes? |
I think it's okay to merge. This edge case doesn't cause issues on my system (Windows 10), so I can't debug @Calinou's problem on Windows 11. I believe fixing it should be in a separate PR done by someone else. |
Thanks! Congratulations on your first contribution! 🎉 |
Fixes #97128.
Use case described by @Maran23 in #97128 (comment) still doesn't work. I can look into it later.