summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gdm-display.c48
-rw-r--r--daemon/gdm-display.h4
-rw-r--r--daemon/gdm-display.xml3
-rw-r--r--daemon/gdm-local-display-factory.c65
-rw-r--r--daemon/gdm-server.c8
-rw-r--r--daemon/gdm-simple-slave.c15
-rw-r--r--daemon/gdm-slave.c30
-rw-r--r--daemon/gdm-transient-display.c1
8 files changed, 38 insertions, 136 deletions
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index f38ce1db..6ee675ac 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -66,7 +66,6 @@ struct GdmDisplayPrivate
GdmDisplayAccessFile *access_file;
gboolean is_local;
- gboolean switch_on_finish;
guint finish_idle_id;
GdmSlaveProxy *slave_proxy;
@@ -85,7 +84,6 @@ enum {
PROP_X11_COOKIE,
PROP_X11_AUTHORITY_FILE,
PROP_IS_LOCAL,
- PROP_SWITCH_ON_FINISH,
PROP_SLAVE_COMMAND,
};
@@ -136,14 +134,6 @@ gdm_display_get_status (GdmDisplay *display)
return display->priv->status;
}
-gboolean
-gdm_display_get_switch_on_finish (GdmDisplay *display)
-{
- g_return_val_if_fail (GDM_IS_DISPLAY (display), 0);
-
- return display->priv->switch_on_finish;
-}
-
static GdmDisplayAccessFile *
_create_access_file_for_user (GdmDisplay *display,
const char *username,
@@ -834,30 +824,6 @@ _gdm_display_set_is_local (GdmDisplay *display,
}
static void
-_gdm_display_set_switch_on_finish (GdmDisplay *display,
- gboolean switch_on_finish)
-{
- display->priv->switch_on_finish = switch_on_finish;
-}
-
-gboolean
-gdm_display_set_switch_on_finish (GdmDisplay *display,
- gboolean switch_display,
- GError **error)
-{
- gboolean ret = TRUE;
-
- g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
-
- g_debug ("GdmDisplay: Setting display to %sswitch to login screen on finish",
- switch_display? "" : "not ");
-
- _gdm_display_set_switch_on_finish (display, switch_display);
-
- return ret;
-}
-
-static void
_gdm_display_set_slave_command (GdmDisplay *display,
const char *command)
{
@@ -900,9 +866,6 @@ gdm_display_set_property (GObject *object,
case PROP_IS_LOCAL:
_gdm_display_set_is_local (self, g_value_get_boolean (value));
break;
- case PROP_SWITCH_ON_FINISH:
- _gdm_display_set_switch_on_finish (self, g_value_get_boolean (value));
- break;
case PROP_SLAVE_COMMAND:
_gdm_display_set_slave_command (self, g_value_get_string (value));
break;
@@ -951,9 +914,6 @@ gdm_display_get_property (GObject *object,
case PROP_IS_LOCAL:
g_value_set_boolean (value, self->priv->is_local);
break;
- case PROP_SWITCH_ON_FINISH:
- g_value_set_boolean (value, self->priv->switch_on_finish);
- break;
case PROP_SLAVE_COMMAND:
g_value_set_string (value, self->priv->slave_command);
break;
@@ -1126,14 +1086,6 @@ gdm_display_class_init (GdmDisplayClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class,
- PROP_SWITCH_ON_FINISH,
- g_param_spec_boolean ("switch-on-finish",
- NULL,
- NULL,
- TRUE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
- g_object_class_install_property (object_class,
PROP_SLAVE_COMMAND,
g_param_spec_string ("slave-command",
"slave command",
diff --git a/daemon/gdm-display.h b/daemon/gdm-display.h
index e3aa8605..607ea1d4 100644
--- a/daemon/gdm-display.h
+++ b/daemon/gdm-display.h
@@ -88,7 +88,6 @@ GQuark gdm_display_error_quark (void);
GType gdm_display_get_type (void);
int gdm_display_get_status (GdmDisplay *display);
-gboolean gdm_display_get_switch_on_finish (GdmDisplay *display);
time_t gdm_display_get_creation_time (GdmDisplay *display);
char * gdm_display_get_user_auth (GdmDisplay *display);
@@ -141,9 +140,6 @@ gboolean gdm_display_remove_user_authorization (GdmDisplay *disp
gboolean gdm_display_set_slave_bus_name (GdmDisplay *display,
const char *name,
GError **error);
-gboolean gdm_display_set_switch_on_finish (GdmDisplay *display,
- gboolean switch_display,
- GError **error);
G_END_DECLS
diff --git a/daemon/gdm-display.xml b/daemon/gdm-display.xml
index d3ce4a4c..a92e37fc 100644
--- a/daemon/gdm-display.xml
+++ b/daemon/gdm-display.xml
@@ -35,9 +35,6 @@
<method name="SetSlaveBusName">
<arg name="name" direction="in" type="s"/>
</method>
- <method name="SetSwitchOnFinish">
- <arg name="switch_display" direction="in" type="b"/>
- </method>
<method name="GetTimedLoginDetails">
<arg name="enabled" direction="out" type="b"/>
<arg name="username" direction="out" type="s"/>
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index e42695e9..437c9e97 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -64,8 +64,7 @@ static void gdm_local_display_factory_class_init (GdmLocalDisplayFactoryC
static void gdm_local_display_factory_init (GdmLocalDisplayFactory *factory);
static void gdm_local_display_factory_finalize (GObject *object);
-static GdmDisplay *create_display (GdmLocalDisplayFactory *factory,
- GType type);
+static GdmDisplay *create_display (GdmLocalDisplayFactory *factory);
static gpointer local_display_factory_object = NULL;
@@ -198,7 +197,21 @@ gdm_local_display_factory_create_transient_display (GdmLocalDisplayFactory *fact
ret = FALSE;
- display = create_display (factory, GDM_TYPE_TRANSIENT_DISPLAY);
+ num = take_next_display_number (factory);
+
+ g_debug ("GdmLocalDisplayFactory: Creating transient display %d", num);
+
+ display = gdm_transient_display_new (num);
+
+ /* FIXME: don't hardcode seat1? */
+ g_object_set (display, "seat-id", CK_SEAT1_PATH, NULL);
+
+ store_display (factory, num, display);
+
+ if (! gdm_display_manage (display)) {
+ display = NULL;
+ goto out;
+ }
if (! gdm_display_get_id (display, id, NULL)) {
display = NULL;
@@ -207,6 +220,9 @@ gdm_local_display_factory_create_transient_display (GdmLocalDisplayFactory *fact
ret = TRUE;
out:
+ /* ref either held by store or not at all */
+ g_object_unref (display);
+
return ret;
}
@@ -258,22 +274,13 @@ gdm_local_display_factory_create_product_display (GdmLocalDisplayFactory *factor
}
static void
-switch_to_login_session (GdmLocalDisplayFactory *factory)
-{
- /* FIXME: look for existing login session before starting a new one */
- create_display (factory, GDM_TYPE_TRANSIENT_DISPLAY);
-}
-
-static void
-on_display_status_changed (GdmDisplay *display,
- GParamSpec *arg1,
- GdmLocalDisplayFactory *factory)
+on_static_display_status_changed (GdmDisplay *display,
+ GParamSpec *arg1,
+ GdmLocalDisplayFactory *factory)
{
int status;
- gboolean switch_on_finish;
GdmDisplayStore *store;
int num;
- GType type;
num = -1;
gdm_display_get_x11_display_number (display, &num, NULL);
@@ -282,8 +289,6 @@ on_display_status_changed (GdmDisplay *display,
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
status = gdm_display_get_status (display);
- switch_on_finish = gdm_display_get_switch_on_finish (display);
- type = G_OBJECT_TYPE (display);
g_debug ("GdmLocalDisplayFactory: static display status changed: %d", status);
switch (status) {
@@ -294,12 +299,7 @@ on_display_status_changed (GdmDisplay *display,
gdm_display_store_remove (store, display);
/* reset num failures */
factory->priv->num_failures = 0;
-
- if (switch_on_finish) {
- switch_to_login_session (factory);
- } else if (type == GDM_TYPE_STATIC_DISPLAY) {
- create_display (factory, type);
- }
+ create_display (factory);
break;
case GDM_DISPLAY_FAILED:
/* leave the display number in factory->priv->displays
@@ -312,7 +312,7 @@ on_display_status_changed (GdmDisplay *display,
/* FIXME: should monitor hardware changes to
try again when seats change */
} else {
- create_display (factory, type);
+ create_display (factory);
}
break;
case GDM_DISPLAY_UNMANAGED:
@@ -328,26 +328,25 @@ on_display_status_changed (GdmDisplay *display,
}
static GdmDisplay *
-create_display (GdmLocalDisplayFactory *factory,
- GType type)
+create_display (GdmLocalDisplayFactory *factory)
{
GdmDisplay *display;
guint32 num;
num = take_next_display_number (factory);
- if (type == GDM_TYPE_STATIC_DISPLAY) {
- display = gdm_static_display_new (num);
- } else if (type == GDM_TYPE_TRANSIENT_DISPLAY) {
- display = gdm_transient_display_new (num);
- }
+#if 0
+ display = gdm_static_factory_display_new (num);
+#else
+ display = gdm_static_display_new (num);
+#endif
/* FIXME: don't hardcode seat1? */
g_object_set (display, "seat-id", CK_SEAT1_PATH, NULL);
g_signal_connect (display,
"notify::status",
- G_CALLBACK (on_display_status_changed),
+ G_CALLBACK (on_static_display_status_changed),
factory);
store_display (factory, num, display);
@@ -374,7 +373,7 @@ gdm_local_display_factory_start (GdmDisplayFactory *base_factory)
ret = TRUE;
/* FIXME: use seat configuration */
- display = create_display (factory, GDM_TYPE_STATIC_DISPLAY);
+ display = create_display (factory);
if (display == NULL) {
ret = FALSE;
}
diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
index a995a034..62ffca13 100644
--- a/daemon/gdm-server.c
+++ b/daemon/gdm-server.c
@@ -52,12 +52,6 @@
extern char **environ;
-#ifdef WITH_VT_SWITCH_WORKAROUND
-#define X_SERVER_COMMAND_LINE X_SERVER " -br -verbose -logverbose 7"
-#else
-#define X_SERVER_COMMAND_LINE X_SERVER " -br -verbose -logverbose 7 -novtswitch"
-#endif
-
#define GDM_SERVER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_SERVER, GdmServerPrivate))
/* These are the servstat values, also used as server
@@ -933,7 +927,7 @@ gdm_server_init (GdmServer *server)
server->priv = GDM_SERVER_GET_PRIVATE (server);
server->priv->pid = -1;
- server->priv->command = g_strdup (X_SERVER_COMMAND_LINE);
+ server->priv->command = g_strdup (X_SERVER " -br -verbose -logverbose 7");
server->priv->log_dir = g_strdup (LOGDIR);
add_ready_handler (server);
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
index 305637f0..2f0163f3 100644
--- a/daemon/gdm-simple-slave.c
+++ b/daemon/gdm-simple-slave.c
@@ -463,17 +463,12 @@ start_session_timeout (GdmSimpleSlave *slave)
if (migrated) {
destroy_session (slave);
-#ifdef WITH_VT_SWITCH_WORKAROUND
- /* If the X server doesn't support -novtswitch, then when the
- * user logs out from their session later, they're going to get thrown
- * back to the VT the greeter is currently running on. We keep the
- * greeter alive here, so when that happens the user doesn't see
- * a blank VT or some confusing thing.
- */
+ /* We don't stop the slave here because
+ when Xorg exits it switches to the VT it was
+ started from. That interferes with fast
+ user switching. */
queue_greeter_reset (slave);
-#else
- gdm_slave_stopped (GDM_SLAVE (slave));
-#endif
+
goto out;
}
diff --git a/daemon/gdm-slave.c b/daemon/gdm-slave.c
index 9fd65794..2dc0323f 100644
--- a/daemon/gdm-slave.c
+++ b/daemon/gdm-slave.c
@@ -1438,31 +1438,6 @@ session_unlock (GdmSlave *slave,
return TRUE;
}
-static void
-set_switch_display_on_finish (GdmSlave *slave,
- gboolean switch_display)
-{
- gboolean res;
- GError *error;
-
- error = NULL;
- res = dbus_g_proxy_call (slave->priv->display_proxy,
- "SetSwitchOnFinish",
- &error,
- G_TYPE_BOOLEAN, switch_display,
- G_TYPE_INVALID,
- G_TYPE_INVALID);
-
- if (! res) {
- if (error != NULL) {
- g_warning ("Failed to set respawn on parent display: %s", error->message);
- g_error_free (error);
- } else {
- g_warning ("Failed to set respawn on parent display");
- }
- }
-}
-
gboolean
gdm_slave_switch_to_user_session (GdmSlave *slave,
const char *username)
@@ -1493,11 +1468,6 @@ gdm_slave_switch_to_user_session (GdmSlave *slave,
g_debug ("GdmSlave: unable to unlock session: %s", ssid_to_activate);
}
- /* Since we're switching to a new display, make sure we don't switch again when
- * this display finishes.
- */
- set_switch_display_on_finish (slave, FALSE);
-
ret = TRUE;
out:
diff --git a/daemon/gdm-transient-display.c b/daemon/gdm-transient-display.c
index 991429f4..13d7bfe0 100644
--- a/daemon/gdm-transient-display.c
+++ b/daemon/gdm-transient-display.c
@@ -159,7 +159,6 @@ gdm_transient_display_new (int display_number)
object = g_object_new (GDM_TYPE_TRANSIENT_DISPLAY,
"x11-display-number", display_number,
"x11-display-name", x11_display,
- "switch-on-finish", TRUE,
NULL);
g_free (x11_display);