[Xfce4-commits] <thunar:master> Fallback to activation root for pre-unmount of cdroms.
Nick Schermer
noreply at xfce.org
Sat Oct 13 16:12:29 CEST 2012
Updating branch refs/heads/master
to 17dd6e7fd6bd5561b5a32d7bf0d12c7cadc641a8 (commit)
from 28783086cff64b50f1e321165a85ea0e849f7dae (commit)
commit 17dd6e7fd6bd5561b5a32d7bf0d12c7cadc641a8
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