backends/native: Move some initialization from init() to initable_init()

This means we can report the errors properly, instead of logging a
warning and calling exit(1).

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
This commit is contained in:
Jonas Ådahl 2019-01-10 11:54:07 +01:00 committed by Georges Basile Stavracas Neto
parent 73e8127d5d
commit 44905d96da

View File

@ -527,7 +527,12 @@ meta_backend_native_initable_init (GInitable *initable,
return FALSE;
}
native->launcher = meta_launcher_new (error);
if (!native->launcher)
return FALSE;
native->udev = meta_udev_new ();
native->barrier_manager = meta_barrier_manager_native_new ();
return initable_parent_iface->init (initable, cancellable, error);
}
@ -573,16 +578,6 @@ meta_backend_native_class_init (MetaBackendNativeClass *klass)
static void
meta_backend_native_init (MetaBackendNative *native)
{
GError *error = NULL;
native->launcher = meta_launcher_new (&error);
if (native->launcher == NULL)
{
g_warning ("Can't initialize KMS backend: %s\n", error->message);
exit (1);
}
native->barrier_manager = meta_barrier_manager_native_new ();
}
MetaLauncher *