[gdm] legacy-display: ensure X11 display device is propagated to launch environment



commit db9ee470fb16bddd4be9755e91130c4ef099566c
Author: Ray Strode <rstrode redhat com>
Date:   Tue Apr 7 10:57:36 2015 -0400

    legacy-display: ensure X11 display device is propagated to launch environment
    
    Once the server associated with the login screen session is ready, we
    query its display device for ConsoleKit.  This device needs to get
    propagated to the session to ensure ConsoleKit can track session
    activeness properly.
    
    This commit makes sure the display device is plumbed from the GdmServer
    object to the GdmLaunchEnvironment object where it gets used by the
    the login session (and subsequently the user session).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747351

 daemon/gdm-launch-environment.c |    2 +-
 daemon/gdm-legacy-display.c     |   15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gdm-launch-environment.c b/daemon/gdm-launch-environment.c
index dc73ffc..aaf7834 100644
--- a/daemon/gdm-launch-environment.c
+++ b/daemon/gdm-launch-environment.c
@@ -795,7 +795,7 @@ gdm_launch_environment_class_init (GdmLaunchEnvironmentClass *klass)
                                                               "device",
                                                               "device",
                                                               NULL,
-                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+                                                              G_PARAM_READWRITE));
         g_object_class_install_property (object_class,
                                          PROP_X11_DISPLAY_IS_LOCAL,
                                          g_param_spec_boolean ("x11-display-is-local",
diff --git a/daemon/gdm-legacy-display.c b/daemon/gdm-legacy-display.c
index 6214c42..9c99923 100644
--- a/daemon/gdm-legacy-display.c
+++ b/daemon/gdm-legacy-display.c
@@ -144,6 +144,21 @@ on_server_ready (GdmServer       *server,
                 g_debug ("GdmDisplay: could not connect to display");
                 gdm_display_unmanage (GDM_DISPLAY (self));
         } else {
+                GdmLaunchEnvironment *launch_environment;
+                char *display_device;
+
+                display_device = gdm_server_get_display_device (server);
+
+                g_object_get (G_OBJECT (self),
+                              "launch-environment", &launch_environment,
+                              NULL);
+                g_object_set (G_OBJECT (launch_environment),
+                              "x11-display-device",
+                              display_device,
+                              NULL);
+                g_clear_pointer(&display_device, g_free);
+                g_clear_object (&launch_environment);
+
                 g_debug ("GdmDisplay: connected to display");
                 g_object_set (G_OBJECT (self), "status", GDM_DISPLAY_MANAGED, NULL);
         }


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