compositor: send the output_created signal after inserting it in the list
The compositor's output_created signal used to be sent in weston_output_init()
which the backend call before putting the output in the output_list.
This caused problems when creating a new view in a listener to that signal,
because weston_view_assign_output() doesn't yet know the new output exists.
To fix this add a new weston_composito_add_output() func which adds the
output in the list and later sends the signal, and make the backends call
that.
diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
index bac6b87..7c505ce 100644
--- a/src/compositor-fbdev.c
+++ b/src/compositor-fbdev.c
@@ -581,7 +581,7 @@
output->finish_frame_timer =
wl_event_loop_add_timer(loop, finish_frame_handler, output);
- wl_list_insert(compositor->base.output_list.prev, &output->base.link);
+ weston_compositor_add_output(&compositor->base, &output->base);
weston_log("fbdev output %d×%d px\n",
output->mode.width, output->mode.height);