summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamjan Jovanovic <damjan.jov@gmail.com>2021-03-03 18:22:00 +0200
committerDamjan Jovanovic <damjan.jov@gmail.com>2021-03-19 19:42:17 +0200
commit981787fd860346d2e43104d45dd650a84503d6a6 (patch)
treec584790839f4c242d18be9c25f5634d4bf3b6f4a
parent3a1428a4d93a218455d6ca1b02ed1b1b95161648 (diff)
downloadgvfs-981787fd860346d2e43104d45dd650a84503d6a6.tar.gz
udisks2: Report unmount progress after showing blocking processes
The "show-unmount-progress" signal isn't emitted when unmounting is successful while the "show-processes" dialog is open. The "aborted" signal is sent to close the dialog, not to indicate an error, and shouldn't be taken into consideration when deciding whether to emit "show-unmount-progress". Further details on the bug report. Get gvfs_udisks2_unmount_notify_stop() to send "show-unmount-progress" whether there was a prior "aborted" or not. Closes https://gitlab.gnome.org/GNOME/gvfs/-/issues/546
-rw-r--r--monitor/udisks2/gvfsudisks2utils.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/monitor/udisks2/gvfsudisks2utils.c b/monitor/udisks2/gvfsudisks2utils.c
index df56962b..9f7cf65d 100644
--- a/monitor/udisks2/gvfsudisks2utils.c
+++ b/monitor/udisks2/gvfsudisks2utils.c
@@ -580,7 +580,6 @@ typedef struct {
GDrive *drive;
GMountOperation *op;
- gboolean op_aborted;
gboolean show_processes_up;
guint unmount_timer_id;
@@ -688,13 +687,6 @@ unmount_notify_op_show_processes (UnmountNotifyData *data)
}
static void
-unmount_notify_op_aborted (UnmountNotifyData *data)
-{
- unmount_notify_stop_timer (data);
- data->op_aborted = TRUE;
-}
-
-static void
unmount_notify_op_reply (UnmountNotifyData *data,
GMountOperationResult result)
{
@@ -704,7 +696,7 @@ unmount_notify_op_reply (UnmountNotifyData *data,
if ((result == G_MOUNT_OPERATION_HANDLED && data->show_processes_up && choice == 1) ||
result == G_MOUNT_OPERATION_ABORTED)
- unmount_notify_op_aborted (data);
+ unmount_notify_stop_timer (data);
else if (result == G_MOUNT_OPERATION_HANDLED)
unmount_notify_ensure_timer (data);
@@ -748,7 +740,7 @@ unmount_notify_data_for_operation (GMountOperation *op,
unmount_notify_data_free);
g_signal_connect_swapped (data->op, "aborted",
- G_CALLBACK (unmount_notify_op_aborted), data);
+ G_CALLBACK (unmount_notify_stop_timer), data);
g_signal_connect_swapped (data->op, "show-processes",
G_CALLBACK (unmount_notify_op_show_processes), data);
g_signal_connect_swapped (data->op, "reply",
@@ -780,7 +772,7 @@ gvfs_udisks2_unmount_notify_stop (GMountOperation *op,
unmount_notify_stop_timer (data);
- if (data->op_aborted || unmount_failed)
+ if (unmount_failed)
return;
name = unmount_notify_get_name (data);