diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 5f7b78c8ec2c63d9cc8dd9b0822a4882308d3663..0c46c38130711cf602b3a3f32ff1f42cb7a08e8d 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -3711,7 +3711,8 @@ thunar_window_device_pre_unmount (ThunarDeviceMonitor *device_monitor,
     return;
 
   /* check if the file is the current directory or an ancestor of the current directory */
-  if (thunar_file_is_gfile_ancestor (window->current_directory, root_file))
+  if (g_file_equal (thunar_file_get_file (window->current_directory), root_file)
+      || thunar_file_is_gfile_ancestor (window->current_directory, root_file))
     {
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       /* change to the home folder */