Skip to content

Some unmount operation busy-dialog fixes - #2826

Open
vjr wants to merge 9 commits into
mainfrom
vishal/unmount-busy-dialog-fixes
Open

Some unmount operation busy-dialog fixes#2826
vjr wants to merge 9 commits into
mainfrom
vishal/unmount-busy-dialog-fixes

Conversation

@vjr

@vjr vjr commented Sep 4, 2026

Copy link
Copy Markdown
Member

Following changes proposed:

  • Automatically close the busy warning dialog when the unmount operation finishes. Previously the dialog would not close when the cancel button was clicked although pressing ESC worked.
  • Special-case to show different dialog messages if the only process is ourself.
  • Exclude ourself from the list of other processes when shown.

vjr added 4 commits September 4, 2026 19:00
Previously it would remain open once the unmount operation completed and clicking the cancel button would have no effect. Pressing ESC would close the dialog though.
If there is only one busy process and it's pid is ours.
Previously it would say "there are other processes" and list itself as "io.elementary.files".
Now the unmount spinner shows and waits until the unmount operation completes.
Let it be abundantly clear to the user that an unmount operation is still in progress instead of just relying on the inconspicuous spinner.
The texts of the dialog are different from the original to not mention "other processes" only "resource is busy" for this special case.
The previous existing busy warning dialog and texts listing the other processes is still shown if there are in fact other processes involved.
@vjr vjr self-assigned this Sep 4, 2026
@vjr
vjr requested review from a team and jeremypw September 4, 2026 14:41
@vjr

vjr commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

This is a follow-up to #2823 to propose some fixes and usability improvements.

@vjr

vjr commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

@jeremypw another one of my drive-by proposed contributions - hopefully this is useful.

@jeremypw jeremypw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - I agree with the intention. Just a couple of suggestions for further clarification.

  • Label the "Cancel" button "Do not unmount" or something similar to clarify the exact consequence of pressing it.
  • When it is Files only using the resource, we could give more information regarding the file operation - or better, disable the sidebar eject button altogether?
  • Expand "Please wait" to clarify what it is the user is waiting for. e.g. " will unmount when the operation finishes."

@vjr

vjr commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

Thanks for this - I agree with the intention. Just a couple of suggestions for further clarification.

  • Label the "Cancel" button "Do not unmount" or something similar to clarify the exact consequence of pressing it.
  • When it is Files only using the resource, we could give more information regarding the file operation - or better, disable the sidebar eject button altogether?
  • Expand "Please wait" to clarify what it is the user is waiting for. e.g. " will unmount when the operation finishes."

I've updated the text in 6ee3d9f how does it look?

I don't know how to set custom text for the CANCEL button - how do I do that?

Not sure how to do item 2 - when Files is the only app using it - how to detect this without the UnmountOperation - or gather more info about whats being done?

@jeremypw

jeremypw commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

I don't know how to set custom text for the CANCEL button - how do I do that?

Use ButtonsType.NONE in the dialog new function and then use add_button in the construct clause. It doesn't matter what response id you choose since this is ignored in this case.

I've updated the text, how does it look?

Not sure whether the balance between brevity and exactitude is right yet. Here is something I mocked up:

Screenshot from 2026-09-08 11 37 27

This probably goes too far into verbosity but it is up to the user to decide whether to wait or cancel unmounting.

I found an issue if the operation in question is a Files transfer. If the transfer is cancelled while the dialog is open, then the dialog does not close and, if cancelled, further attempts to unmount throw the dialog again even though there are no Files operations in progress. This is probably an issue with Files operations code rather than this PR.

Not sure how to do item 2 - when Files is the only app using it - how to detect this without the UnmountOperation - or gather more info about whats being done?

I'll look into it.

@vjr

vjr commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

I found an issue if the operation in question is a Files transfer. If the transfer is cancelled while the dialog is open, then the dialog does not close and, if cancelled, further attempts to unmount throw the dialog again even though there are no Files operations in progress. This is probably an issue with Files operations code rather than this PR.

This should be fixed by d3abac0

Please re-test the overall PR when you can, thanks!

Comment on lines +51 to +52
public unowned GLib.File? src_mount = null;
public unowned GLib.File? dest_mount = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little confusing that these a called *_mount but are not Mount objects. Could these not be called *_folder perhaps.

@jeremypw

Copy link
Copy Markdown
Contributor

@vjr

Not sure how to do item 2 - when Files is the only app using it - how to detect this without the UnmountOperation - or gather more info about whats being done?

In principle some information can be obtained from the ProgressInfo objects listed in ProgressInfoManager, however at the moment I think some changes would be required to get this to work which are outside the scope of this PR.

I am drafting some more ported Vala code which includes a FileOperationsManager that maintains a list of ongoing jobs. If this is made available to the UI then it should be straightforward to display the required information.

@jeremypw

Copy link
Copy Markdown
Contributor

This should be fixed by d3abac0

This commit does fix the issue - thanks! The only comment I would make is that if the ongoing Files operation is cancelled then the dialog closes without unmounting the mount which is in contrast to what happens if the operation is allowed to proceed to the end and contradicts the text in the dialog somewhat.

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