From c5c3aae0864c73755324154b5f970283cf4829dd Mon Sep 17 00:00:00 2001
From: Theo Linkspfeifer <lastonestanding@tutanota.com>
Date: Fri, 13 Mar 2020 22:56:14 +0100
Subject: [PATCH] Always jump to Home when ejecting a currently viewed device
 (Bug #16504)

---
 thunar/thunar-window.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 5f7b78c8e..0c46c3813 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 */
-- 
GitLab