[nautilus/wip/antoniof/gtk4-preparation-drop-outgoing-api: 3/13] file: Pass parent window to unmount operation




commit 2bf80eeab26ef5fea29c9c2fc03ef555406ba29a
Author: António Fernandes <antoniof gnome org>
Date:   Sun Aug 15 17:48:09 2021 +0100

    file: Pass parent window to unmount operation
    
    It's conveniently set as a property of GtkMountOperation, so there is no
    reason not to pass both forward.
    
    This is necessary for the preceding commit to actually work as intended.

 src/nautilus-file.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index c14356d8f..8f62d9a10 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -1404,11 +1404,15 @@ nautilus_file_unmount (NautilusFile                  *file,
     else if (file->details->mount != NULL &&
              g_mount_can_unmount (file->details->mount))
     {
+        GtkWindow *parent;
+
+        parent = gtk_mount_operation_get_parent (GTK_MOUNT_OPERATION (mount_op));
+
         data = g_new0 (UnmountData, 1);
         data->file = nautilus_file_ref (file);
         data->callback = callback;
         data->callback_data = callback_data;
-        nautilus_file_operations_unmount_mount_full (NULL, file->details->mount, NULL, FALSE, TRUE, 
unmount_done, data);
+        nautilus_file_operations_unmount_mount_full (parent, file->details->mount, mount_op, FALSE, TRUE, 
unmount_done, data);
     }
     else if (callback)
     {
@@ -1447,11 +1451,15 @@ nautilus_file_eject (NautilusFile                  *file,
     else if (file->details->mount != NULL &&
              g_mount_can_eject (file->details->mount))
     {
+        GtkWindow *parent;
+
+        parent = gtk_mount_operation_get_parent (GTK_MOUNT_OPERATION (mount_op));
+
         data = g_new0 (UnmountData, 1);
         data->file = nautilus_file_ref (file);
         data->callback = callback;
         data->callback_data = callback_data;
-        nautilus_file_operations_unmount_mount_full (NULL, file->details->mount, NULL, TRUE, TRUE, 
unmount_done, data);
+        nautilus_file_operations_unmount_mount_full (parent, file->details->mount, mount_op, TRUE, TRUE, 
unmount_done, data);
     }
     else if (callback)
     {


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