diff -up ./src/daemon/daemon.c.0000 ./src/daemon/daemon.c --- ./src/daemon/daemon.c.0000 2014-10-23 00:35:52.000000000 +0300 +++ ./src/daemon/daemon.c 2015-03-31 10:58:40.057227066 +0300 @@ -100,7 +100,6 @@ typedef struct { struct _NotifyDaemonPrivate { guint next_id; guint timeout_source; - guint exit_timeout_source; GHashTable* idle_reposition_notify_ids; GHashTable* monitored_window_hash; GHashTable* notification_hash; @@ -151,35 +150,6 @@ static void _notify_timeout_destroy(Noti g_free(nt); } -static gboolean do_exit(gpointer user_data) -{ - //g_debug("Exiting due to inactivity"); - exit(1); - - return FALSE; -} - -static void add_exit_timeout(NotifyDaemon* daemon) -{ - if (daemon->priv->exit_timeout_source > 0) - { - return; - } - - daemon->priv->exit_timeout_source = g_timeout_add_seconds(IDLE_SECONDS, do_exit, NULL); -} - -static void remove_exit_timeout(NotifyDaemon* daemon) -{ - if (daemon->priv->exit_timeout_source == 0) - { - return; - } - - g_source_remove(daemon->priv->exit_timeout_source); - daemon->priv->exit_timeout_source = 0; -} - static void create_stack_for_monitor(NotifyDaemon* daemon, GdkScreen* screen, int monitor_num) { int screen_num = gdk_screen_get_number(screen); @@ -360,8 +330,6 @@ static void notify_daemon_init(NotifyDae daemon->priv->next_id = 1; daemon->priv->timeout_source = 0; - add_exit_timeout(daemon); - daemon->gsettings = g_settings_new (GSETTINGS_SCHEMA); location = g_settings_get_string (daemon->gsettings, GSETTINGS_KEY_POPUP_LOCATION); @@ -423,8 +391,6 @@ static void notify_daemon_finalize(GObje gdk_window_remove_filter(NULL, (GdkFilterFunc) _notify_x11_filter, daemon); } - remove_exit_timeout(daemon); - g_hash_table_destroy(daemon->priv->monitored_window_hash); g_hash_table_destroy(daemon->priv->idle_reposition_notify_ids); g_hash_table_destroy(daemon->priv->notification_hash); @@ -522,11 +488,6 @@ static void _close_notification(NotifyDa } g_hash_table_remove(priv->notification_hash, &id); - - if (g_hash_table_size(daemon->priv->notification_hash) == 0) - { - add_exit_timeout(daemon); - } } } @@ -744,11 +705,6 @@ static gboolean _check_expiration(Notify if (!has_more_timeouts) { daemon->priv->timeout_source = 0; - - if (g_hash_table_size (daemon->priv->notification_hash) == 0) - { - add_exit_timeout(daemon); - } } return has_more_timeouts; @@ -826,7 +782,6 @@ static NotifyTimeout* _store_notificatio _calculate_timeout(daemon, nt, timeout); g_hash_table_insert(priv->notification_hash, g_memdup(&id, sizeof(guint)), nt); - remove_exit_timeout(daemon); return nt; }