rpi: launcher must init before udev-seat

udev-seat will call weston_launcher_open(), so we better init launcher
first. Fixes a segfault.

Cc: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Pekka Paalanen 2013-12-04 15:34:48 +02:00 committed by Kristian Høgsberg
parent 53b41c7890
commit 477333285e

View File

@ -511,13 +511,6 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],
goto out_compositor;
}
if (udev_input_init(&compositor->input,
&compositor->base,
compositor->udev, "seat0") != 0) {
weston_log("Failed to initialize udev input.\n");
goto out_udev;
}
compositor->session_listener.notify = session_notify;
wl_signal_add(&compositor->base.session_signal,
&compositor ->session_listener);
@ -525,7 +518,7 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],
weston_launcher_connect(&compositor->base, param->tty, "seat0");
if (!compositor->base.launcher) {
weston_log("Failed to initialize tty.\n");
goto out_udev_input;
goto out_udev;
}
compositor->base.destroy = rpi_compositor_destroy;
@ -537,6 +530,13 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],
weston_log("Dispmanx planes are %s buffered.\n",
compositor->single_buffer ? "single" : "double");
if (udev_input_init(&compositor->input,
&compositor->base,
compositor->udev, "seat0") != 0) {
weston_log("Failed to initialize udev input.\n");
goto out_launcher;
}
for (key = KEY_F1; key < KEY_F9; key++)
weston_compositor_add_key_binding(&compositor->base, key,
MODIFIER_CTRL | MODIFIER_ALT,
@ -552,7 +552,7 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],
bcm_host_init();
if (rpi_renderer_create(&compositor->base, &param->renderer) < 0)
goto out_launcher;
goto out_udev_input;
if (rpi_output_create(compositor, param->output_transform) < 0)
goto out_renderer;
@ -562,12 +562,12 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],
out_renderer:
compositor->base.renderer->destroy(&compositor->base);
out_launcher:
weston_launcher_destroy(compositor->base.launcher);
out_udev_input:
udev_input_destroy(&compositor->input);
out_launcher:
weston_launcher_destroy(compositor->base.launcher);
out_udev:
udev_unref(compositor->udev);