summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2020-09-13 13:25:24 +0100
committerOndrej Holy <oholy@redhat.com>2020-09-16 13:41:20 +0000
commit9fc4fa993e2feec050c593fe795ca3c2cbd6ebb0 (patch)
tree18a080f34bcda68197985ad67985d10847178113
parentca6d56fef057da940704a598100e804cfd74e00d (diff)
downloadnautilus-790-freeze-when-restoring-file-from-trash-if-file-with-same-name-and-location-exists.tar.gz
file-utilities: Don't block main thread to restore from trash790-freeze-when-restoring-file-from-trash-if-file-with-same-name-and-location-exists
The sync variants of file operations have been introduced for use in integration tests. The async operations have been suffixed _async(). However, likely by mistake, in the restore from trash operation, the call has been appended _sync rather than _async. [1] This blocks the main thread until the operation task finishes, causing a dead lock when the operation thread needs the main thread to show a conflict dialog. This happens when restoring a file from trash if a new file with the same name already exists in the original location. Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/790 [1] commit ab31018cdaeb1c592e1c46402c5ae1facc503151
-rw-r--r--src/nautilus-file-utilities.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c
index e6a4b2e58..2ee6e7c05 100644
--- a/src/nautilus-file-utilities.c
+++ b/src/nautilus-file-utilities.c
@@ -818,9 +818,10 @@ ensure_dirs_task_ready_cb (GObject *_source,
files = g_hash_table_lookup (data->original_dirs_hash, original_dir);
locations = locations_from_file_list (files);
- nautilus_file_operations_move_sync
- (locations,
- original_dir_location);
+ nautilus_file_operations_move_async (locations,
+ original_dir_location,
+ data->parent_window,
+ NULL, NULL, NULL);
g_list_free_full (locations, g_object_unref);
g_object_unref (original_dir_location);