mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 14:30:18 +01:00
Wed Oct 13 John (J5) Palmieri <johnp@redhat.com>
* info-daemon/NetworkManagerInfo.c (nmi_spawn_notification_icon): Stop respawning
if the notification icon crashes 5 times within 5 seconds of each respawn
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@221 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
dea7d5684e
commit
aea83cfba0
3 changed files with 44 additions and 11 deletions
|
|
@ -1,3 +1,8 @@
|
|||
Wed Oct 13 John (J5) Palmieri <johnp@redhat.com>
|
||||
|
||||
* info-daemon/NetworkManagerInfo.c (nmi_spawn_notification_icon): Stop respawning
|
||||
if the notification icon crashes 5 times within 5 seconds of each respawn
|
||||
|
||||
Tue Oct 12 22:53:04 2004 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* panel-applet/NMWirelessApplet.c (nmwa_update_state): remove
|
||||
|
|
|
|||
|
|
@ -109,19 +109,45 @@ nmi_spawn_notification_icon (NMIAppInfo *info)
|
|||
if (info->notification_icon_watch != NULL)
|
||||
g_source_remove (info->notification_icon_watch);
|
||||
|
||||
/*spawn the panel notification icon*/
|
||||
if (!g_spawn_async (NULL,
|
||||
notification_icon_cmd,
|
||||
NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL,
|
||||
&(info->notification_icon_pid),
|
||||
&error))
|
||||
{
|
||||
g_warning ("Could not spawn NetworkManager's notification icon (%s)", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
if (info->notification_icon_respawn_timer == NULL)
|
||||
info->notification_icon_respawn_timer = g_timer_new();
|
||||
else
|
||||
info->notification_icon_watch = g_child_watch_add (info->notification_icon_pid, on_icon_exit_callback, info);
|
||||
{
|
||||
gdouble elapsed_time;
|
||||
gulong dummy;
|
||||
|
||||
elapsed_time = g_timer_elapsed (info->notification_icon_respawn_timer, &dummy);
|
||||
|
||||
/*5 seconds between respawns*/
|
||||
if (elapsed_time > 5)
|
||||
info->notification_icon_respawn_counter = 0;
|
||||
else
|
||||
info->notification_icon_respawn_counter++;
|
||||
|
||||
}
|
||||
|
||||
g_timer_start (info->notification_icon_respawn_timer);
|
||||
|
||||
/*spawn the panel notification icon unless it has crashed numerous times within a time frame*/
|
||||
if (info->notification_icon_respawn_counter < 5)
|
||||
{
|
||||
if (!g_spawn_async (NULL,
|
||||
notification_icon_cmd,
|
||||
NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL,
|
||||
&(info->notification_icon_pid),
|
||||
&error))
|
||||
{
|
||||
g_warning ("Could not spawn NetworkManager's notification icon (%s)", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
{
|
||||
info->notification_icon_watch = g_child_watch_add (info->notification_icon_pid, on_icon_exit_callback, info);
|
||||
}
|
||||
} else {
|
||||
g_timer_destroy (info->notification_icon_respawn_timer);
|
||||
info->notification_icon_respawn_timer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ struct NMIAppInfo
|
|||
*/
|
||||
GPid notification_icon_pid;
|
||||
guint notification_icon_watch;
|
||||
guint notification_icon_respawn_counter;
|
||||
GTimer *notification_icon_respawn_timer;
|
||||
|
||||
GSource *shutdown_timeout;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue