[gvfs] udisks2: Report unmount progress after showing blocking processes



commit 981787fd860346d2e43104d45dd650a84503d6a6
Author: Damjan Jovanovic <damjan jov gmail com>
Date:   Wed Mar 3 18:22:00 2021 +0200

    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

 monitor/udisks2/gvfsudisks2utils.c | 14 +++-----------
 1 file 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;
@@ -687,13 +686,6 @@ unmount_notify_op_show_processes (UnmountNotifyData *data)
   data->show_processes_up = TRUE;
 }
 
-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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]