Commit b2fb259e authored by Laurent Bigonville's avatar Laurent Bigonville

Add an option to use GDM as a standalone XDMCP server

This patch add an option (xdmcp/ShowLocalGreeter) to disable the local X
console and turn GDM into a simple XDMCP server

Thanks to Patrick Monnerat and Josselin Mouette for the patch

https://bugzilla.gnome.org/show_bug.cgi?id=567522
parent c14b16af
......@@ -43,6 +43,7 @@ G_BEGIN_DECLS
#define GDM_KEY_DISALLOW_TCP "security/DisallowTCP"
#define GDM_KEY_XDMCP_ENABLE "xdmcp/Enable"
#define GDM_KEY_SHOW_LOCAL_GREETER "xdmcp/ShowLocalGreeter"
#define GDM_KEY_MAX_PENDING "xdmcp/MaxPending"
#define GDM_KEY_MAX_SESSIONS "xdmcp/MaxSessions"
#define GDM_KEY_MAX_WAIT "xdmcp/MaxWait"
......
......@@ -65,7 +65,7 @@ struct GdmManagerPrivate
gboolean started;
gboolean wait_for_go;
gboolean no_console;
gboolean show_local_greeter;
GDBusProxy *bus_proxy;
GDBusConnection *connection;
......@@ -74,7 +74,8 @@ struct GdmManagerPrivate
enum {
PROP_0,
PROP_XDMCP_ENABLED
PROP_XDMCP_ENABLED,
PROP_SHOW_LOCAL_GREETER
};
enum {
......@@ -544,7 +545,7 @@ gdm_manager_start (GdmManager *manager)
{
g_debug ("GdmManager: GDM starting to manage displays");
if (! manager->priv->wait_for_go) {
if (! manager->priv->wait_for_go && (!manager->priv->xdmcp_enabled || manager->priv->show_local_greeter)) {
gdm_display_factory_start (GDM_DISPLAY_FACTORY (manager->priv->local_factory));
}
......@@ -570,7 +571,9 @@ gdm_manager_set_wait_for_go (GdmManager *manager,
if (! wait_for_go) {
/* we got a go */
gdm_display_factory_start (GDM_DISPLAY_FACTORY (manager->priv->local_factory));
if (!manager->priv->xdmcp_enabled || manager->priv->show_local_greeter) {
gdm_display_factory_start (GDM_DISPLAY_FACTORY (manager->priv->local_factory));
}
#ifdef HAVE_LIBXDMCP
if (manager->priv->xdmcp_enabled && manager->priv->xdmcp_factory != NULL) {
......@@ -643,6 +646,15 @@ gdm_manager_set_xdmcp_enabled (GdmManager *manager,
}
void
gdm_manager_set_show_local_greeter (GdmManager *manager,
gboolean show_local_greeter)
{
g_return_if_fail (GDM_IS_MANAGER (manager));
manager->priv->show_local_greeter = show_local_greeter;
}
static void
gdm_manager_set_property (GObject *object,
guint prop_id,
......@@ -657,6 +669,9 @@ gdm_manager_set_property (GObject *object,
case PROP_XDMCP_ENABLED:
gdm_manager_set_xdmcp_enabled (self, g_value_get_boolean (value));
break;
case PROP_SHOW_LOCAL_GREETER:
gdm_manager_set_show_local_greeter (self, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -677,6 +692,9 @@ gdm_manager_get_property (GObject *object,
case PROP_XDMCP_ENABLED:
g_value_set_boolean (value, self->priv->xdmcp_enabled);
break;
case PROP_SHOW_LOCAL_GREETER:
g_value_set_boolean (value, self->priv->show_local_greeter);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......
......@@ -71,6 +71,8 @@ void gdm_manager_set_wait_for_go (GdmManager *mana
void gdm_manager_set_xdmcp_enabled (GdmManager *manager,
gboolean enabled);
void gdm_manager_set_show_local_greeter (GdmManager *manager,
gboolean show_local_greeter);
gboolean gdm_manager_get_displays (GdmManager *manager,
GPtrArray **displays,
GError **error);
......
......@@ -440,6 +440,7 @@ on_name_acquired (GDBusConnection *bus,
gpointer user_data)
{
gboolean xdmcp_enabled;
gboolean show_local_greeter;
manager = gdm_manager_new ();
if (manager == NULL) {
......@@ -451,6 +452,10 @@ on_name_acquired (GDBusConnection *bus,
gdm_manager_start (manager);
show_local_greeter = TRUE;
gdm_settings_direct_get_boolean (GDM_KEY_SHOW_LOCAL_GREETER, &show_local_greeter);
gdm_manager_set_show_local_greeter (manager, show_local_greeter);
xdmcp_enabled = FALSE;
gdm_settings_direct_get_boolean (GDM_KEY_XDMCP_ENABLE, &xdmcp_enabled);
gdm_manager_set_xdmcp_enabled (manager, xdmcp_enabled);
......
......@@ -69,6 +69,11 @@
<signature>b</signature>
<default>false</default>
</schema>
<schema>
<key>xdmcp/ShowLocalGreeter</key>
<signature>b</signature>
<default>true</default>
</schema>
<schema>
<key>xdmcp/MaxPending</key>
<signature>i</signature>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment