static void
display_manager_seat_removed_cb (DisplayManager *display_manager, Seat *seat)
{
- const gchar *type;
gchar **types;
gchar **iter;
- gboolean make_seats = FALSE;
Seat *next_seat = NULL;
+ GString *next_types;
/* If we have fallback types registered for the seat, let's try them
- before giving up. This code does not expect a type name to appear twice
- in the type list. It is a configuration error to do so. */
- type = seat_get_type_name (seat);
+ before giving up. */
types = seat_get_string_list_property (seat, "type");
+ next_types = g_string_new ("");
for (iter = types; iter && *iter; iter++)
{
- if (g_strcmp0 (type, *iter) == 0)
- make_seats = TRUE;
- else if (make_seats) {
+ if (iter == types)
+ continue; // skip first one, that is our current seat type
+
+ if (!next_seat)
+ {
next_seat = seat_new (*iter);
- if (next_seat)
- break;
+ g_string_assign (next_types, *iter);
+ }
+ else
+ {
+ // Build up list of types to try next time
+ g_string_append_c (next_types, ';');
+ g_string_append (next_types, *iter);
}
}
g_strfreev (types);
if (seat_get_boolean_property (seat, "exit-on-failure"))
seat_set_property (next_seat, "exit-on-failure", "true");
+ seat_set_property (next_seat, "type", next_types->str);
+ g_string_free (next_types, TRUE);
+
display_manager_add_seat (display_manager, next_seat);
g_object_unref (next_seat);
}
return seat;
}
-const gchar *
-seat_get_type_name (Seat *seat)
-{
- GList *values = NULL;
- GList *iter;
- const gchar *name = NULL;
-
- if (seat_modules)
- values = g_hash_table_get_values (seat_modules);
-
- for (iter = values; iter; iter = iter->next)
- {
- SeatModule *module = (SeatModule *)iter->data;
- if (module->type == G_OBJECT_TYPE (seat))
- {
- name = module->name;
- break;
- }
- }
-
- g_list_free (values);
- return name;
-}
-
void
seat_set_property (Seat *seat, const gchar *name, const gchar *value)
{
Seat *seat_new (const gchar *module_name);
-const gchar *seat_get_type_name (Seat *seat);
-
void seat_set_property (Seat *seat, const gchar *name, const gchar *value);
const gchar *seat_get_string_property (Seat *seat, const gchar *name);
return-value=1
[SeatDefaults]
-type=unity;xlocal;
+type=unity;INVALID;unity;xlocal;
#?RUNNER DAEMON-START
#?UNITY-SYSTEM-COMPOSITOR START VT=7 XDG_VTNR=7
#?UNITY-SYSTEM-COMPOSITOR EXIT CODE=1
+# System compositor fails to start a second time
+#?UNITY-SYSTEM-COMPOSITOR START VT=7 XDG_VTNR=7
+#?UNITY-SYSTEM-COMPOSITOR EXIT CODE=1
+
# X server starts in VT mode
#?XSERVER-0 START VT=7