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

Fix drop onto unmounted drive bookmark Part 1 #2466

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Sep 1, 2024

Fixes #2390
Fixes #2465

  • file_accepts_drop () returns false if location unmounted (fixes first issue)
  • Update the target location if mounted after Files started (fixes second issue)

Extracted from #2391 without last substantive commit to reduce diff.

The last substantive commit does not seem necessary to fix the linked issues. An unmounted drive bookmark is created with an incorrect target but this PR prevents it from being dropped on and corrects the target when the drive is mounted.

Correctly creating the bookmark will be fixed separately as it is possible it could cause a bug.

@jeremypw jeremypw requested a review from a team September 1, 2024 18:11
@zeebok
Copy link
Contributor

zeebok commented Oct 8, 2024

Both before and after trying to test this on OS8 stable, if I try to repro the first issue with a USB and drag a file to it, the file remains and a link to that file is created next to it. Nothing is list to a blackhole.

@jeremypw
Copy link
Collaborator Author

jeremypw commented Oct 8, 2024

@zeebok

Nothing is list to a blackhole

Not sure what that means - do you mean the original file does not disappear as reported in the original issue?

drag a file to it

The issue occurs when dropping a file onto the sidebar bookmark of an unmounted drive/volume - is that what you did? I just checked again and in main, the file disappears from its original location but the drive/volume remains unmounted. Pressing <Ctrl>Z causes the file to reappear. It is in fact moved to the user home directory instead of the drive/volume. In this PR the drop just fails (for simplicity). Automounting may be implemented later.

@jeremypw
Copy link
Collaborator Author

jeremypw commented Oct 8, 2024

I am running OS8 in a VM at the moment so its difficult to reproduce this issue there. I am testing with OS7.1.

@jeremypw
Copy link
Collaborator Author

jeremypw commented Oct 8, 2024

the file remains and a link to that file is created next to it

This is what happens when a file is dragged and dropped into its own location. The drag icon should show a "link" emblem in that case.

@zeebok
Copy link
Contributor

zeebok commented Oct 9, 2024

Not sure what that means - do you mean the original file does not disappear as reported in the original issue?

Sorry, typo, meant nothing was lost* in a blackhole from dragging and dropping.

The issue occurs when dropping a file onto the sidebar bookmark of an unmounted drive/volume - is that what you did? I just checked again and in main, the file disappears from its original location but the drive/volume remains unmounted. Pressing <Ctrl>Z causes the file to reappear. It is in fact moved to the user home directory instead of the drive/volume. In this PR the drop just fails (for simplicity). Automounting may be implemented later.

Yep, I plugged in a USB drive, didn't let it mount, went to a source code folder and duplicated a file with a very obvious test name, then tried to drag it to the USB drive. It didn't try to move it and just made a link of the file that sat next to the original test file. I can try and snag a video if you'd like to see!

@jeremypw
Copy link
Collaborator Author

jeremypw commented Oct 9, 2024

That's strange - I'd like to see the video.

It didn't try to move it

I presume drag and drop is, in general working for you? i.e. a drag started normally and you could drop the drag icon onto the USB bookmark OK? But on dropping, a link was created in the original folder? In that case it was the original folder that registered the drop event which is weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants