aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-02-24 20:00:37 +0100
committerGuido Günther <agx@sigxcpu.org>2011-02-24 20:00:37 +0100
commitf841a703c404f3147e64d59228091609fb035424 (patch)
treeb5cb056f5bdf84bff2a5471ad7bd7c5e0744b370 /src
parentAdapt to new GTK+ 3 naming scheme (diff)
parentNew upstream version 2.91.90 (diff)
downloadkrb5-auth-dialog-f841a703c404f3147e64d59228091609fb035424.tar.gz
krb5-auth-dialog-f841a703c404f3147e64d59228091609fb035424.tar.bz2
krb5-auth-dialog-f841a703c404f3147e64d59228091609fb035424.zip
Merge commit 'upstream/2.91.90'
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/Makefile.in2
-rw-r--r--src/ka-applet.c36
-rw-r--r--src/ka-dialog.c20
-rw-r--r--src/krb5-auth-dialog.ui (renamed from src/krb5-auth-dialog.xml)0
5 files changed, 39 insertions, 21 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 1c89d31..fb64219 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -105,7 +105,7 @@ AM_CPPFLAGS = \
pkgdatadir = $(datadir)/krb5-auth-dialog
pkgdata_DATA = \
- krb5-auth-dialog.xml \
+ krb5-auth-dialog.ui \
$(NULL)
EXTRA_DIST = \
diff --git a/src/Makefile.in b/src/Makefile.in
index 612e7c4..12cb8fa 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -409,7 +409,7 @@ AM_CPPFLAGS = \
$(NULL)
pkgdata_DATA = \
- krb5-auth-dialog.xml \
+ krb5-auth-dialog.ui \
$(NULL)
EXTRA_DIST = \
diff --git a/src/ka-applet.c b/src/ka-applet.c
index b2b2823..7de9204 100644
--- a/src/ka-applet.c
+++ b/src/ka-applet.c
@@ -950,21 +950,31 @@ ka_ns_check_persistence (KaApplet *self)
{
GList *caps;
GList *l;
+ gboolean is_autostart = g_getenv("DESKTOP_AUTOSTART_ID") ? TRUE : FALSE;
+ gint seconds = 5;
self->priv->ns_persistence = FALSE;
- caps = notify_get_server_caps ();
- if (caps == NULL) {
+ do {
+ caps = notify_get_server_caps ();
+ if (caps == NULL)
g_warning ("Failed to read server caps");
- return;
- }
-
- l = g_list_find_custom (caps, "persistence", (GCompareFunc)strcmp);
- if (l != NULL) {
- self->priv->ns_persistence = TRUE;
- KA_DEBUG ("Notification server supports persistence.");
- }
- g_list_foreach (caps, (GFunc) g_free, NULL);
- g_list_free (caps);
+ else {
+ l = g_list_find_custom (caps, "persistence", (GCompareFunc)strcmp);
+ if (l != NULL) {
+ self->priv->ns_persistence = TRUE;
+ KA_DEBUG ("Notification server supports persistence.");
+ }
+ g_list_foreach (caps, (GFunc) g_free, NULL);
+ g_list_free (caps);
+ }
+ /* During session start we have to wait until the shell is fully up
+ * to reliably detect the persistence property (#642666) */
+ if (is_autostart && !self->priv->ns_persistence) {
+ sleep(1);
+ seconds--;
+ } else
+ break;
+ } while (seconds);
}
@@ -989,7 +999,7 @@ ka_applet_create ()
applet->priv->uixml = gtk_builder_new ();
ret = gtk_builder_add_from_file (applet->priv->uixml,
KA_DATA_DIR G_DIR_SEPARATOR_S
- PACKAGE ".xml", &error);
+ PACKAGE ".ui", &error);
if (!ret) {
g_assert (error);
g_assert (error->message);
diff --git a/src/ka-dialog.c b/src/ka-dialog.c
index ce86367..3114f49 100644
--- a/src/ka-dialog.c
+++ b/src/ka-dialog.c
@@ -502,6 +502,15 @@ credentials_expiring (gpointer *data)
}
+/* run once, then terminate the timer */
+static gboolean
+credentials_expiring_once (gpointer *data)
+{
+ credentials_expiring(data);
+ return FALSE;
+}
+
+
/*
* set ticket options by looking at krb5.conf and gconf
*/
@@ -1056,9 +1065,10 @@ main (int argc, char *argv[])
const char *help_msg = "Run '" PACKAGE " --help' to see a full list of available command line options";
const GOptionEntry options [] = {
{"auto", 'a', 0, G_OPTION_ARG_NONE, &run_auto,
- "Only run if an initialized ccache is found (default)", NULL},
+ "Only run if an initialized ccache is found", NULL},
+ /* accepted for compatibility only */
{"always", 'A', 0, G_OPTION_ARG_NONE, &run_always,
- "Always run", NULL},
+ "Always run (default)", NULL},
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
GFileMonitor *monitor = NULL;
@@ -1085,10 +1095,7 @@ main (int argc, char *argv[])
if (!ka_dbus_connect (&status))
exit(status);
- if (run_always && !run_auto) {
- always_run = TRUE;
- }
-
+ always_run = !run_auto;
if (using_krb5 () || always_run) {
g_set_application_name (KA_NAME);
@@ -1098,6 +1105,7 @@ main (int argc, char *argv[])
ka_nm_init();
g_timeout_add_seconds (CREDENTIAL_CHECK_INTERVAL, (GSourceFunc)credentials_expiring, applet);
+ g_idle_add ((GSourceFunc)credentials_expiring_once, applet);
monitor = monitor_ccache (applet);
ka_dbus_service(applet);
diff --git a/src/krb5-auth-dialog.xml b/src/krb5-auth-dialog.ui
index f36f537..f36f537 100644
--- a/src/krb5-auth-dialog.xml
+++ b/src/krb5-auth-dialog.ui
bgstack15