diff options
author | Guido Günther <agx@sigxcpu.org> | 2009-04-24 11:28:49 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-04-24 11:28:49 +0200 |
commit | 9d5cdf24ef40097737cdb3ecd2ac1331653b471f (patch) | |
tree | 2df5ea1d5ce717daac6c6b3bf4f071ba3e43b5f2 /src/krb5-auth-applet.c | |
parent | Imported Upstream version 0.9~rc1 (diff) | |
download | krb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.tar.gz krb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.tar.bz2 krb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.zip |
Imported Upstream version 0.9+0gitec60300
Diffstat (limited to 'src/krb5-auth-applet.c')
-rw-r--r-- | src/krb5-auth-applet.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/src/krb5-auth-applet.c b/src/krb5-auth-applet.c index 6e02ed8..b528ae9 100644 --- a/src/krb5-auth-applet.c +++ b/src/krb5-auth-applet.c @@ -371,13 +371,26 @@ ka_applet_select_icon(KaApplet* applet, int remaining) } +#ifdef HAVE_LIBNOTIFY +static gboolean +show_notification (KaApplet *applet) +{ + /* wait for the panel to be settled before showing a bubble */ + if (gtk_status_icon_is_embedded (applet->priv->tray_icon)) { + notify_notification_show (applet->priv->notification, NULL); + } else { + g_timeout_add_seconds (5, (GSourceFunc)show_notification, applet); + } + return FALSE; +} + + static void -ka_send_event_notification (KaApplet *applet G_GNUC_UNUSED, - const char *summary G_GNUC_UNUSED, - const char *message G_GNUC_UNUSED, - const char *icon G_GNUC_UNUSED) +ka_send_event_notification (KaApplet *applet, + const char *summary, + const char *message, + const char *icon) { -#ifdef HAVE_LIBNOTIFY const char *notify_icon; g_return_if_fail (applet != NULL); @@ -398,9 +411,17 @@ ka_send_event_notification (KaApplet *applet G_GNUC_UNUSED, notify_notification_new_with_status_icon(summary, message, notify_icon, applet->priv->tray_icon); notify_notification_set_urgency (applet->priv->notification, NOTIFY_URGENCY_NORMAL); - notify_notification_show (applet->priv->notification, NULL); -#endif /* HAVE_LIBNOTIFY */ + show_notification (applet); +} +#else +static void +ka_send_event_notification (KaApplet *applet G_GNUC_UNUSED, + const char *summary G_GNUC_UNUSED, + const char *message G_GNUC_UNUSED, + const char *icon G_GNUC_UNUSED) +{ } +#endif /* ! HAVE_LIBNOTIFY */ /* update the tray icon's tooltip and icon */ |