summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2011-05-12 16:36:39 -0400
committerRay Strode <rstrode@redhat.com>2011-06-15 09:58:59 -0400
commit15a3f0c699fe1e8583a33d744edfbb0801ab92bf (patch)
treef4e492219848dd347a0cfb4973b9e5b629e7362e /gui
parent8bf1de19c95b3069e108c9e477785c4e654801f7 (diff)
downloadgdm-15a3f0c699fe1e8583a33d744edfbb0801ab92bf.tar.gz
daemon: clean up greeter when unused
When user switching GDM needs to show a transient greeter for the user to pick a name from the list and jump to that session. After the user has been jumped to the selected session we don't really have a use for the greeter session. Historically, we've kept it around anyway, though, because X by default jumps back to the VT it started on when it exits, and we don't want the user to get thrown to an empty VT after they log out. This commit changes X to get started with the "-novtswitch" option, so that it doesn't do the undesirable switch-on-exit thing. This allows us to clean up the useless greeter following user switches. Based on work by Josselin Mouette <joss@debian.org> https://bugzilla.gnome.org/show_bug.cgi?id=618047
Diffstat (limited to 'gui')
-rw-r--r--gui/libgdmgreeter/gdm-greeter-client.c94
-rw-r--r--gui/libgdmgreeter/gdm-greeter-client.h6
2 files changed, 48 insertions, 52 deletions
diff --git a/gui/libgdmgreeter/gdm-greeter-client.c b/gui/libgdmgreeter/gdm-greeter-client.c
index cb1ce00b..c712d2bd 100644
--- a/gui/libgdmgreeter/gdm-greeter-client.c
+++ b/gui/libgdmgreeter/gdm-greeter-client.c
@@ -54,6 +54,7 @@ struct GdmGreeterClientPrivate
enum {
PROP_0,
+ PROP_DISPLAY_IS_LOCAL
};
enum {
@@ -95,6 +96,13 @@ gdm_greeter_client_error_quark (void)
return error_quark;
}
+/**
+ * gdm_greeter_get_display_is_local:
+ *
+ * @client: a #GdmGreeterClient
+ *
+ * Returns: %TRUE if display is local display
+ */
gboolean
gdm_greeter_client_get_display_is_local (GdmGreeterClient *client)
{
@@ -643,7 +651,8 @@ send_get_display_id (GdmGreeterClient *client,
return ret;
}
-char *
+
+static char *
gdm_greeter_client_call_get_display_id (GdmGreeterClient *client)
{
char *display_id;
@@ -779,9 +788,20 @@ client_dbus_filter_function (DBusConnection *connection,
return DBUS_HANDLER_RESULT_HANDLED;
}
+/**
+ * gdm_greeter_client_connect:
+ *
+ * @client: a #GdmGreeterClient
+ *
+ * Initiates a connection to GDM daemon "slave" process.
+ *
+ * This function should be called before doing other calls.
+ *
+ * Returns: %TRUE if connected, or %FALSE if unavailable
+ */
gboolean
-gdm_greeter_client_start (GdmGreeterClient *client,
- GError **error)
+gdm_greeter_client_connect (GdmGreeterClient *client,
+ GError **error)
{
gboolean ret;
DBusError local_error;
@@ -833,61 +853,35 @@ gdm_greeter_client_start (GdmGreeterClient *client,
return ret;
}
-void
-gdm_greeter_client_stop (GdmGreeterClient *client)
-{
- g_return_if_fail (GDM_IS_GREETER_CLIENT (client));
-
-}
-
static void
-gdm_greeter_client_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+gdm_greeter_client_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- switch (prop_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
static void
-gdm_greeter_client_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+gdm_greeter_client_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
+ GdmGreeterClient *self;
+
+ self = GDM_GREETER_CLIENT (object);
+
switch (prop_id) {
+ case PROP_DISPLAY_IS_LOCAL:
+ g_value_set_boolean (value, self->priv->display_is_local);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
-static GObject *
-gdm_greeter_client_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
-{
- GdmGreeterClient *greeter_client;
-
- greeter_client = GDM_GREETER_CLIENT (G_OBJECT_CLASS (gdm_greeter_client_parent_class)->constructor (type,
- n_construct_properties,
- construct_properties));
-
- return G_OBJECT (greeter_client);
-}
-
-static void
-gdm_greeter_client_dispose (GObject *object)
-{
- g_debug ("GdmGreeterClient: Disposing greeter_client");
-
- G_OBJECT_CLASS (gdm_greeter_client_parent_class)->dispose (object);
-}
-
static void
gdm_greeter_client_class_init (GdmGreeterClientClass *klass)
{
@@ -895,8 +889,6 @@ gdm_greeter_client_class_init (GdmGreeterClientClass *klass)
object_class->get_property = gdm_greeter_client_get_property;
object_class->set_property = gdm_greeter_client_set_property;
- object_class->constructor = gdm_greeter_client_constructor;
- object_class->dispose = gdm_greeter_client_dispose;
object_class->finalize = gdm_greeter_client_finalize;
g_type_class_add_private (klass, sizeof (GdmGreeterClientPrivate));
@@ -1032,6 +1024,14 @@ gdm_greeter_client_class_init (GdmGreeterClientClass *klass)
g_cclosure_marshal_generic,
G_TYPE_NONE,
1, G_TYPE_STRING);
+
+ g_object_class_install_property (object_class,
+ PROP_DISPLAY_IS_LOCAL,
+ g_param_spec_boolean ("display-is-local",
+ "display is local",
+ "display is local",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
}
static void
diff --git a/gui/libgdmgreeter/gdm-greeter-client.h b/gui/libgdmgreeter/gdm-greeter-client.h
index d0eaf58a..9b2be8d8 100644
--- a/gui/libgdmgreeter/gdm-greeter-client.h
+++ b/gui/libgdmgreeter/gdm-greeter-client.h
@@ -87,14 +87,10 @@ GQuark gdm_greeter_client_error_quark (void);
GdmGreeterClient * gdm_greeter_client_new (void);
-gboolean gdm_greeter_client_start (GdmGreeterClient *client,
+gboolean gdm_greeter_client_connect (GdmGreeterClient *client,
GError **error);
-void gdm_greeter_client_stop (GdmGreeterClient *client);
-
gboolean gdm_greeter_client_get_display_is_local (GdmGreeterClient *client);
-char * gdm_greeter_client_call_get_display_id (GdmGreeterClient *client);
-
void gdm_greeter_client_call_start_conversation (GdmGreeterClient *client,
const char *service_name);
void gdm_greeter_client_call_begin_auto_login (GdmGreeterClient *client,