[gdm/initial-setup: 2/4] initial-setup: get on session bus



commit 022289f479f8c56384adc5c14973034e0ea3ee95
Author: Ray Strode <rstrode redhat com>
Date:   Wed May 18 14:48:05 2011 -0400

    initial-setup: get on session bus
    
    This will make sure the program exits when the greeter session
    is over, etc.

 gui/initial-setup/gdm-initial-setup.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gui/initial-setup/gdm-initial-setup.c b/gui/initial-setup/gdm-initial-setup.c
index b9a09da..9c15991 100644
--- a/gui/initial-setup/gdm-initial-setup.c
+++ b/gui/initial-setup/gdm-initial-setup.c
@@ -1458,12 +1458,17 @@ main (int argc, char *argv[])
 
         gtk_init (&argc, &argv);
 
+        error = NULL;
+        if (g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error) == NULL) {
+                g_error ("Couldn't get on session bus: %s", error->message);
+                exit (1);
+        };
+
         filename = UIDIR "/setup.ui";
         if (!g_file_test (filename, G_FILE_TEST_EXISTS))
                 filename = "setup.ui";
 
         setup->builder = gtk_builder_new ();
-        error = NULL;
         if (!gtk_builder_add_from_file (setup->builder, filename, &error)) {
                 g_error ("%s", error->message);
                 g_error_free (error);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]