diff -up gvfs-1.0.1/monitor/hal/ghalvolume.c.fix-mounting gvfs-1.0.1/monitor/hal/ghalvolume.c --- gvfs-1.0.1/monitor/hal/ghalvolume.c.fix-mounting 2008-09-10 11:51:23.000000000 -0400 +++ gvfs-1.0.1/monitor/hal/ghalvolume.c 2008-09-29 12:16:02.000000000 -0400 @@ -760,9 +760,10 @@ spawn_cb (GPid pid, gint status, gpointe GSimpleAsyncResult *simple; /* ensure that the #GHalMount corrosponding to the #GHalVolume we've - * mounted is made available before returning to the user + * mounted is made available before returning to the user (make sure + * we don't emit the signals in idle; see #552168). */ - g_hal_volume_monitor_force_update (G_HAL_VOLUME_MONITOR (G_HAL_VOLUME (data->object)->volume_monitor)); + g_hal_volume_monitor_force_update (G_HAL_VOLUME_MONITOR (G_HAL_VOLUME (data->object)->volume_monitor), FALSE); if (WEXITSTATUS (status) != 0) { diff -up gvfs-1.0.1/monitor/hal/ghalvolumemonitor.c.fix-mounting gvfs-1.0.1/monitor/hal/ghalvolumemonitor.c --- gvfs-1.0.1/monitor/hal/ghalvolumemonitor.c.fix-mounting 2008-09-10 11:51:13.000000000 -0400 +++ gvfs-1.0.1/monitor/hal/ghalvolumemonitor.c 2008-09-29 12:16:02.000000000 -0400 @@ -82,7 +82,8 @@ static void hal_changed (Ha HalDevice *device, gpointer user_data); static void update_all (GHalVolumeMonitor *monitor, - gboolean emit_changes); + gboolean emit_changes, + gboolean emit_in_idle); static void update_drives (GHalVolumeMonitor *monitor, GList **added_drives, GList **removed_drives); @@ -367,7 +368,7 @@ mountpoints_changed (GUnixMountMonitor * { GHalVolumeMonitor *monitor = G_HAL_VOLUME_MONITOR (user_data); - update_all (monitor, TRUE); + update_all (monitor, TRUE, TRUE); } static void @@ -376,13 +377,13 @@ mounts_changed (GUnixMountMonitor *mount { GHalVolumeMonitor *monitor = G_HAL_VOLUME_MONITOR (user_data); - update_all (monitor, TRUE); + update_all (monitor, TRUE, TRUE); } void -g_hal_volume_monitor_force_update (GHalVolumeMonitor *monitor) +g_hal_volume_monitor_force_update (GHalVolumeMonitor *monitor, gboolean emit_in_idle) { - update_all (monitor, TRUE); + update_all (monitor, TRUE, emit_in_idle); } static void @@ -394,7 +395,7 @@ hal_changed (HalPool *pool, /*g_warning ("hal changed");*/ - update_all (monitor, TRUE); + update_all (monitor, TRUE, TRUE); } static GObject * @@ -448,7 +449,7 @@ g_hal_volume_monitor_constructor (GType "device_removed", G_CALLBACK (hal_changed), monitor); - update_all (monitor, FALSE); + update_all (monitor, FALSE, TRUE); G_LOCK (hal_vm); the_volume_monitor = monitor; @@ -973,7 +974,8 @@ emit_lists_in_idle (gpointer data) /* Must be called from idle if emit_changes, with no locks held */ static void update_all (GHalVolumeMonitor *monitor, - gboolean emit_changes) + gboolean emit_changes, + gboolean emit_in_idle) { ChangedLists *lists; GList *added_drives, *removed_drives; @@ -1007,7 +1009,10 @@ update_all (GHalVolumeMonitor *monitor, lists->added_mounts = added_mounts; lists->removed_mounts = removed_mounts; - g_idle_add (emit_lists_in_idle, lists); + if (emit_in_idle) + g_idle_add (emit_lists_in_idle, lists); + else + emit_lists_in_idle (lists); } else { diff -up gvfs-1.0.1/monitor/hal/ghalvolumemonitor.h.fix-mounting gvfs-1.0.1/monitor/hal/ghalvolumemonitor.h --- gvfs-1.0.1/monitor/hal/ghalvolumemonitor.h.fix-mounting 2008-09-10 11:51:13.000000000 -0400 +++ gvfs-1.0.1/monitor/hal/ghalvolumemonitor.h 2008-09-29 12:16:02.000000000 -0400 @@ -51,7 +51,8 @@ struct _GHalVolumeMonitorClass { GType g_hal_volume_monitor_get_type (void) G_GNUC_CONST; GVolumeMonitor *g_hal_volume_monitor_new (void); -void g_hal_volume_monitor_force_update (GHalVolumeMonitor *monitor); +void g_hal_volume_monitor_force_update (GHalVolumeMonitor *monitor, + gboolean emit_in_idle); G_END_DECLS diff -up gvfs-1.0.1/monitor/proxy/gproxyvolume.c.fix-mounting gvfs-1.0.1/monitor/proxy/gproxyvolume.c --- gvfs-1.0.1/monitor/proxy/gproxyvolume.c.fix-mounting 2008-09-29 13:26:28.000000000 -0400 +++ gvfs-1.0.1/monitor/proxy/gproxyvolume.c 2008-09-29 13:26:44.000000000 -0400 @@ -539,7 +539,7 @@ mount_cb (DBusMessage *reply, data->callback, data->user_data, NULL); - g_simple_async_result_complete (simple); + g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); g_object_unref (data->object);