[gdm/wip/xserver-in-session: 21/54] display: merge GdmStaticDisplay and GdmTransientDisplay



commit 7860519d4508f82474e48f890cd2f4173c6c88f2
Author: Ray Strode <rstrode redhat com>
Date:   Tue Feb 3 14:00:26 2015 -0500

    display: merge GdmStaticDisplay and GdmTransientDisplay
    
    They basically do the same thing with very minor differences,
    so merge them into a new GdmLocalDisplay object.

 daemon/Makefile.am                                 |   34 ++----
 daemon/gdm-local-display-factory.c                 |   16 ++-
 .../{gdm-static-display.c => gdm-local-display.c}  |   54 +++++-----
 .../{gdm-static-display.h => gdm-local-display.h}  |   30 +++---
 ...dm-static-display.xml => gdm-local-display.xml} |    2 +-
 daemon/gdm-transient-display.c                     |  119 --------------------
 daemon/gdm-transient-display.h                     |   57 ----------
 daemon/gdm-transient-display.xml                   |    5 -
 8 files changed, 62 insertions(+), 255 deletions(-)
---
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 6b80972..949cf36 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -35,8 +35,7 @@ AM_CPPFLAGS = \
 BUILT_SOURCES =                                        \
        gdm-display-glue.h                      \
        gdm-manager-glue.h                      \
-       gdm-static-display-glue.h               \
-       gdm-transient-display-glue.h            \
+       gdm-local-display-glue.h                \
        gdm-local-display-factory-glue.h        \
        gdm-session-glue.h                      \
        gdm-session-worker-glue.h               \
@@ -56,19 +55,12 @@ gdm-display-glue.c gdm-display-glue.h: gdm-display.xml Makefile.am
                --generate-c-code=gdm-display-glue                      \
                $(srcdir)/gdm-display.xml
 
-gdm-transient-display-glue.c gdm-transient-display-glue.h: gdm-transient-display.xml Makefile.am
+gdm-local-display-glue.c gdm-local-display-glue.h: gdm-local-display.xml Makefile.am
        $(AM_V_GEN)gdbus-codegen                                        \
                --c-namespace=GdmDBus                                   \
                --interface-prefix=org.gnome.DisplayManager             \
-               --generate-c-code=gdm-transient-display-glue            \
-               $(srcdir)/gdm-transient-display.xml
-
-gdm-static-display-glue.c gdm-static-display-glue.h: gdm-static-display.xml Makefile.am
-       $(AM_V_GEN)gdbus-codegen                                        \
-               --c-namespace=GdmDBus                                   \
-               --interface-prefix=org.gnome.DisplayManager             \
-               --generate-c-code=gdm-static-display-glue               \
-               $(srcdir)/gdm-static-display.xml
+               --generate-c-code=gdm-local-display-glue                \
+               $(srcdir)/gdm-local-display.xml
 
 gdm-local-display-factory-glue.c gdm-local-display-factory-glue.h : gdm-local-display-factory.xml Makefile.am
        $(AM_V_GEN)gdbus-codegen                                        \
@@ -186,10 +178,8 @@ gdm_SOURCES =                      \
        gdm-local-display-factory.h     \
        gdm-display.c                   \
        gdm-display.h                   \
-       gdm-static-display.c            \
-       gdm-static-display.h            \
-       gdm-transient-display.c         \
-       gdm-transient-display.h         \
+       gdm-local-display.c             \
+       gdm-local-display.h             \
        gdm-launch-environment.c        \
        gdm-launch-environment.h        \
        gdm-manager.c                   \
@@ -221,10 +211,8 @@ nodist_gdm_SOURCES =                       \
        gdm-local-display-factory-glue.c        \
        gdm-manager-glue.h                      \
        gdm-manager-glue.c                      \
-       gdm-transient-display-glue.h            \
-       gdm-transient-display-glue.c            \
-       gdm-static-display-glue.h               \
-       gdm-static-display-glue.c               \
+       gdm-local-display-glue.h                \
+       gdm-local-display-glue.c                \
        gdm-session-glue.h                      \
        gdm-session-glue.c                      \
        gdm-session-worker-glue.c               \
@@ -279,8 +267,7 @@ CLEANFILES =                                        \
        gdm-session-glue.c                      \
        gdm-session-worker-glue.c               \
        gdm-session-enum-types.c                \
-       gdm-static-display-glue.c               \
-       gdm-transient-display-glue.c            \
+       gdm-local-display-glue.c                \
        $(BUILT_SOURCES)                        \
        $(NULL)
 
@@ -289,8 +276,7 @@ EXTRA_DIST =                                \
        gdm-session-worker.xml          \
        gdm-session.xml                 \
        gdm-display.xml                 \
-       gdm-static-display.xml          \
-       gdm-transient-display.xml       \
+       gdm-local-display.xml           \
        gdm-local-display-factory.xml   \
        gdm-session-enum-types.c.in     \
        gdm-session-enum-types.h.in     \
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index 7457fc3..ba7757d 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -35,8 +35,7 @@
 #include "gdm-local-display-factory-glue.h"
 
 #include "gdm-display-store.h"
-#include "gdm-static-display.h"
-#include "gdm-transient-display.h"
+#include "gdm-local-display.h"
 
 #define GDM_LOCAL_DISPLAY_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
GDM_TYPE_LOCAL_DISPLAY_FACTORY, GdmLocalDisplayFactoryPrivate))
 
@@ -235,10 +234,13 @@ gdm_local_display_factory_create_transient_display (GdmLocalDisplayFactory *fact
 
         g_debug ("GdmLocalDisplayFactory: Creating transient display %d", num);
 
-        display = gdm_transient_display_new (num);
+        display = gdm_local_display_new (num);
 
         seat_id = get_seat_of_transient_display (factory);
-        g_object_set (display, "seat-id", seat_id, NULL);
+        g_object_set (display,
+                      "seat-id", seat_id,
+                      "allow-timed-login", FALSE,
+                      NULL);
 
         store_display (factory, num, display);
 
@@ -291,7 +293,7 @@ on_display_status_changed (GdmDisplay             *display,
                 gdm_display_store_remove (store, display);
 
                 /* Create a new equivalent display if it was static */
-                if (GDM_IS_STATIC_DISPLAY (display)) {
+                if (GDM_IS_LOCAL_DISPLAY (display)) {
                         /* reset num failures */
                         factory->priv->num_failures = 0;
 
@@ -304,7 +306,7 @@ on_display_status_changed (GdmDisplay             *display,
                 gdm_display_store_remove (store, display);
 
                 /* Create a new equivalent display if it was static */
-                if (GDM_IS_STATIC_DISPLAY (display)) {
+                if (GDM_IS_LOCAL_DISPLAY (display)) {
 
                         factory->priv->num_failures++;
 
@@ -370,7 +372,7 @@ create_display (GdmLocalDisplayFactory *factory,
 
         num = take_next_display_number (factory);
 
-        display = gdm_static_display_new (num);
+        display = gdm_local_display_new (num);
 
         g_object_set (display, "seat-id", seat_id, NULL);
         g_object_set (display, "is-initial", initial, NULL);
diff --git a/daemon/gdm-static-display.c b/daemon/gdm-local-display.c
similarity index 54%
rename from daemon/gdm-static-display.c
rename to daemon/gdm-local-display.c
index ba767b0..caaf304 100644
--- a/daemon/gdm-static-display.c
+++ b/daemon/gdm-local-display.c
@@ -38,33 +38,33 @@
 
 #include "gdm-common.h"
 #include "gdm-display.h"
-#include "gdm-static-display.h"
-#include "gdm-static-display-glue.h"
+#include "gdm-local-display.h"
+#include "gdm-local-display-glue.h"
 
-#define GDM_STATIC_DISPLAY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_STATIC_DISPLAY, 
GdmStaticDisplayPrivate))
+#define GDM_LOCAL_DISPLAY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_LOCAL_DISPLAY, 
GdmLocalDisplayPrivate))
 
-struct GdmStaticDisplayPrivate
+struct GdmLocalDisplayPrivate
 {
-        GdmDBusStaticDisplay *skeleton;
+        GdmDBusLocalDisplay *skeleton;
 };
 
-static void     gdm_static_display_class_init   (GdmStaticDisplayClass *klass);
-static void     gdm_static_display_init         (GdmStaticDisplay      *static_display);
+static void     gdm_local_display_class_init   (GdmLocalDisplayClass *klass);
+static void     gdm_local_display_init         (GdmLocalDisplay      *local_display);
 
-G_DEFINE_TYPE (GdmStaticDisplay, gdm_static_display, GDM_TYPE_DISPLAY)
+G_DEFINE_TYPE (GdmLocalDisplay, gdm_local_display, GDM_TYPE_DISPLAY)
 
 static GObject *
-gdm_static_display_constructor (GType                  type,
-                                   guint                  n_construct_properties,
-                                   GObjectConstructParam *construct_properties)
+gdm_local_display_constructor (GType                  type,
+                               guint                  n_construct_properties,
+                               GObjectConstructParam *construct_properties)
 {
-        GdmStaticDisplay      *display;
+        GdmLocalDisplay      *display;
 
-        display = GDM_STATIC_DISPLAY (G_OBJECT_CLASS (gdm_static_display_parent_class)->constructor (type,
-                                                                                                           
n_construct_properties,
-                                                                                                           
construct_properties));
+        display = GDM_LOCAL_DISPLAY (G_OBJECT_CLASS (gdm_local_display_parent_class)->constructor (type,
+                                                                                                   
n_construct_properties,
+                                                                                                   
construct_properties));
 
-        display->priv->skeleton = GDM_DBUS_STATIC_DISPLAY (gdm_dbus_static_display_skeleton_new ());
+        display->priv->skeleton = GDM_DBUS_LOCAL_DISPLAY (gdm_dbus_local_display_skeleton_new ());
 
         g_dbus_object_skeleton_add_interface (gdm_display_get_object_skeleton (GDM_DISPLAY (display)),
                                               G_DBUS_INTERFACE_SKELETON (display->priv->skeleton));
@@ -73,41 +73,41 @@ gdm_static_display_constructor (GType                  type,
 }
 
 static void
-gdm_static_display_finalize (GObject *object)
+gdm_local_display_finalize (GObject *object)
 {
-        GdmStaticDisplay *display = GDM_STATIC_DISPLAY (object);
+        GdmLocalDisplay *display = GDM_LOCAL_DISPLAY (object);
 
         g_clear_object (&display->priv->skeleton);
 
-        G_OBJECT_CLASS (gdm_static_display_parent_class)->finalize (object);
+        G_OBJECT_CLASS (gdm_local_display_parent_class)->finalize (object);
 }
 
 static void
-gdm_static_display_class_init (GdmStaticDisplayClass *klass)
+gdm_local_display_class_init (GdmLocalDisplayClass *klass)
 {
         GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-        object_class->constructor = gdm_static_display_constructor;
-        object_class->finalize = gdm_static_display_finalize;
+        object_class->constructor = gdm_local_display_constructor;
+        object_class->finalize = gdm_local_display_finalize;
 
-        g_type_class_add_private (klass, sizeof (GdmStaticDisplayPrivate));
+        g_type_class_add_private (klass, sizeof (GdmLocalDisplayPrivate));
 }
 
 static void
-gdm_static_display_init (GdmStaticDisplay *static_display)
+gdm_local_display_init (GdmLocalDisplay *local_display)
 {
 
-        static_display->priv = GDM_STATIC_DISPLAY_GET_PRIVATE (static_display);
+        local_display->priv = GDM_LOCAL_DISPLAY_GET_PRIVATE (local_display);
 }
 
 GdmDisplay *
-gdm_static_display_new (int display_number)
+gdm_local_display_new (int display_number)
 {
         GObject *object;
         char    *x11_display;
 
         x11_display = g_strdup_printf (":%d", display_number);
-        object = g_object_new (GDM_TYPE_STATIC_DISPLAY,
+        object = g_object_new (GDM_TYPE_LOCAL_DISPLAY,
                                "x11-display-number", display_number,
                                "x11-display-name", x11_display,
                                NULL);
diff --git a/daemon/gdm-static-display.h b/daemon/gdm-local-display.h
similarity index 50%
rename from daemon/gdm-static-display.h
rename to daemon/gdm-local-display.h
index 4abaa0e..9ece9be 100644
--- a/daemon/gdm-static-display.h
+++ b/daemon/gdm-local-display.h
@@ -19,39 +19,39 @@
  */
 
 
-#ifndef __GDM_STATIC_DISPLAY_H
-#define __GDM_STATIC_DISPLAY_H
+#ifndef __GDM_LOCAL_DISPLAY_H
+#define __GDM_LOCAL_DISPLAY_H
 
 #include <glib-object.h>
 #include "gdm-display.h"
 
 G_BEGIN_DECLS
 
-#define GDM_TYPE_STATIC_DISPLAY         (gdm_static_display_get_type ())
-#define GDM_STATIC_DISPLAY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GDM_TYPE_STATIC_DISPLAY, 
GdmStaticDisplay))
-#define GDM_STATIC_DISPLAY_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GDM_TYPE_STATIC_DISPLAY, 
GdmStaticDisplayClass))
-#define GDM_IS_STATIC_DISPLAY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDM_TYPE_STATIC_DISPLAY))
-#define GDM_IS_STATIC_DISPLAY_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GDM_TYPE_STATIC_DISPLAY))
-#define GDM_STATIC_DISPLAY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDM_TYPE_STATIC_DISPLAY, 
GdmStaticDisplayClass))
+#define GDM_TYPE_LOCAL_DISPLAY         (gdm_local_display_get_type ())
+#define GDM_LOCAL_DISPLAY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GDM_TYPE_LOCAL_DISPLAY, 
GdmLocalDisplay))
+#define GDM_LOCAL_DISPLAY_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GDM_TYPE_LOCAL_DISPLAY, 
GdmLocalDisplayClass))
+#define GDM_IS_LOCAL_DISPLAY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDM_TYPE_LOCAL_DISPLAY))
+#define GDM_IS_LOCAL_DISPLAY_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GDM_TYPE_LOCAL_DISPLAY))
+#define GDM_LOCAL_DISPLAY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDM_TYPE_LOCAL_DISPLAY, 
GdmLocalDisplayClass))
 
-typedef struct GdmStaticDisplayPrivate GdmStaticDisplayPrivate;
+typedef struct GdmLocalDisplayPrivate GdmLocalDisplayPrivate;
 
 typedef struct
 {
         GdmDisplay               parent;
-        GdmStaticDisplayPrivate *priv;
-} GdmStaticDisplay;
+        GdmLocalDisplayPrivate *priv;
+} GdmLocalDisplay;
 
 typedef struct
 {
         GdmDisplayClass   parent_class;
 
-} GdmStaticDisplayClass;
+} GdmLocalDisplayClass;
 
-GType               gdm_static_display_get_type                (void);
-GdmDisplay *        gdm_static_display_new                     (int display_number);
+GType               gdm_local_display_get_type                (void);
+GdmDisplay *        gdm_local_display_new                     (int display_number);
 
 
 G_END_DECLS
 
-#endif /* __GDM_STATIC_DISPLAY_H */
+#endif /* __GDM_LOCAL_DISPLAY_H */
diff --git a/daemon/gdm-static-display.xml b/daemon/gdm-local-display.xml
similarity index 74%
rename from daemon/gdm-static-display.xml
rename to daemon/gdm-local-display.xml
index bd3670b..3d52dd2 100644
--- a/daemon/gdm-static-display.xml
+++ b/daemon/gdm-local-display.xml
@@ -1,5 +1,5 @@
 <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" 
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd";>
 <node>
-  <interface name="org.gnome.DisplayManager.StaticDisplay">
+  <interface name="org.gnome.DisplayManager.LocalDisplay">
   </interface>
 </node>


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