diff --git a/thunar/thunar-notify.c b/thunar/thunar-notify.c index 0f4f832f..587f578b 100644 --- a/thunar/thunar-notify.c +++ b/thunar/thunar-notify.c @@ -227,6 +227,21 @@ thunar_notify_eject (ThunarDevice *device) +#ifdef HAVE_LIBNOTIFY +static void +thunar_notify_finish_close_notification (gpointer user_data) +{ + NotifyNotification *notification = NOTIFY_NOTIFICATION (user_data); + + notify_notification_close (notification, NULL); + g_object_unref (notification); + + return FALSE; +} +#endif + + + void thunar_notify_finish (ThunarDevice *device) { @@ -238,7 +253,8 @@ thunar_notify_finish (ThunarDevice *device) notification = g_object_get_data (G_OBJECT (device), I_("thunar-notification")); if (notification != NULL) { - notify_notification_close (notification, NULL); + g_timeout_add_seconds (2, thunar_notify_finish_close_notification, notification); + g_object_ref (notification); g_object_set_data (G_OBJECT (device), I_("thunar-notification"), NULL); } #endif