Skip to content
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

"Move to Trash" does not move files to Recycle Bin on Windows under specific configuration #47106

Closed
Xrayez opened this issue Mar 17, 2021 · 9 comments · Fixed by #51168
Closed

Comments

@Xrayez
Copy link
Contributor

Xrayez commented Mar 17, 2021

Godot version:
3.2.4 rc

OS/device including version:
Windows 10

Issue description:
Godot does not move files to Recycle Bin when a file is deleted from the filesystem dock with the "Move to Trash" menu option, and when the Recycle Bin is configured so that files are not placed inside Recycle Bin (via "Properties").

Originally showcased by @aaronfranke in godotengine/godot-proposals#2460 (comment).

Steps to reproduce:

Make sure you're configuring the drive where Godot project is located.

Move to Recycle bin (expected)

image

image

image

image

Do not move to Recycle bin (not expected)

image

image

image

image

Minimal reproduction project:
N/A

@akien-mga
Copy link
Member

The message can just be edited to clarify that this depends on having the system trash actually enabled...

@Xrayez
Copy link
Contributor Author

Xrayez commented Mar 17, 2021

I see two possible solutions to this:

  1. Make OS.move_to_trash work on Windows in a way that detects this kind of configuration, and rename the action to either "Delete" or "Move to Trash" depending on Recycle Bin configuration.
  2. Just rename "Move to Trash" back to "Delete" on Windows for all cases, because that's the default name for this action in Windows' context menu. See Rename "Move to Trash/Recycle Bin" back to "Delete" on Windows godot-proposals#2463 (that's the easiest solution).

@akien-mga
Copy link
Member

akien-mga commented Mar 17, 2021

Just rename "Move to Trash" back to "Delete" on Windows for all cases, because that's the default name for this action in Windows' context menu. See godotengine/godot-proposals#2463 (that's the easiest solution).

Nice try, but that doesn't solve the issue, since there's an explicit mention to what the action does in the confirmation dialog shown in your screenshot.

@Xrayez
Copy link
Contributor Author

Xrayez commented Mar 17, 2021

I'm not excluding additional usability enhancements which can be done after the bug fix, I'm saying that it would be enough to revert to previous state on Windows for now (having "Delete" instead of "Move to Trash"), because current behavior is buggy, and is an actual bug from the user standpoint.

Let me explain.

"Delete" on Windows can mean both "Move to Trash" or "Delete" without moving to trash depending on configuration. When a Windows user is aware of this configuration, there's less ambiguity even with the confirmation dialog suggesting otherwise, because a user has to explicitly reconfigure the "Recycle Bin" to act that way in Windows.

"Move to Trash" means exactly what it says on the tin when you see it in Godot, but when a user happens to use the non-default configuration (without moving to trash, again, explicitly enabled), then that's unexpected compared to above case.

The proper fix to this would entail all proposed enhancements, of course.

@Anshul7sp1
Copy link
Contributor

Anshul7sp1 commented Mar 18, 2021

I think a change like this would be intuitive enough for an average user....no?
image

Then again, for a "Windows only" user, the term "recycle bin" would be far more familiar and hence he/she would be clearer on what to expect as the result.

@vignesh-j-shetty
Copy link
Contributor

I see two possible solutions to this:

  1. Make OS.move_to_trash work on Windows in a way that detects this kind of configuration, and rename the action to either "Delete" or "Move to Trash" depending on Recycle Bin configuration.
  2. Just rename "Move to Trash" back to "Delete" on Windows for all cases, because that's the default name for this action in Windows' context menu. See Rename "Move to Trash/Recycle Bin" back to "Delete" on Windows godot-proposals#2463 (that's the easiest solution).

Can you tell how? OS.move_to_trash is called after popup is already displayed right?

@vignesh-j-shetty
Copy link
Contributor

vignesh-j-shetty commented Aug 2, 2021

I searched a bit , there is no any official/clean way to check for recycle bin configuration in windows. I think this issue need to be closed with updated message , nothing much can be done.
I think @Xrayez solution 2 is good enough and only available option.

@Xrayez
Copy link
Contributor Author

Xrayez commented Aug 2, 2021

I don't know how to be honest, but it would be quite surprising to figure out that Windows API does not have a way to check this programmatically. The way I see it, Godot could have OS.can_move_to_trash() method. By default, it would return true for all platforms.

@akien-mga
Copy link
Member

I think that implementing OS specific APIs just for the sake of updating a message that doesn't even need to mention what will happen to the file would really be overkill.

I'll just change the message.

@akien-mga akien-mga added this to the 4.0 milestone Aug 2, 2021
akien-mga added a commit to akien-mga/godot that referenced this issue Aug 2, 2021
akien-mga added a commit to akien-mga/godot that referenced this issue Aug 3, 2021
sairam4123 pushed a commit to sairam4123/godot that referenced this issue Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants