[Xfce4-commits] <thunar:nick/new-shortcuts-pane-model> Fallback to activation root for pre-unmount of cdroms.

Nick Schermer noreply at xfce.org
Sun Oct 7 21:10:03 CEST 2012


Updating branch refs/heads/nick/new-shortcuts-pane-model
         to 52ce3f8bad65a729c7f927d7f87798c4f48ff94d (commit)
       from 3fb2188d023f1c74f0062dfc0b205dac15399dd9 (commit)

commit 52ce3f8bad65a729c7f927d7f87798c4f48ff94d
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Oct 7 21:08:43 2012 +0200

    Fallback to activation root for pre-unmount of cdroms.
    
    Somestimes the mount of the removed volume does not
    give a gfile, try the activation_root insteadso the window
    nicely jumps to home when ejecting a cd.

 thunar/thunar-device.c |    3 +++
 thunar/thunar-window.c |    7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/thunar/thunar-device.c b/thunar/thunar-device.c
index 3ea4f92..0047aa5 100644
--- a/thunar/thunar-device.c
+++ b/thunar/thunar-device.c
@@ -549,6 +549,9 @@ thunar_device_get_root (const ThunarDevice *device)
           root = g_mount_get_root (volume_mount);
           g_object_unref (volume_mount);
         }
+
+      if (root == NULL)
+        root = g_volume_get_activation_root (device->device);
     }
   else if (G_IS_MOUNT (device->device))
     {
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index ccb60d1..eb18d56 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -2825,8 +2825,11 @@ thunar_window_device_removed (ThunarDeviceMonitor *device_monitor,
   _thunar_return_if_fail (THUNAR_IS_WINDOW (window));
 
   root_file = thunar_device_get_root (device);
-  thunar_window_device_pre_unmount (device_monitor, device, root_file, window);
-  g_object_unref (root_file);
+  if (root_file != NULL)
+    {
+      thunar_window_device_pre_unmount (device_monitor, device, root_file, window);
+      g_object_unref (root_file);
+    }
 }
 
 


More information about the Xfce4-commits mailing list