libweston: Decouple weston_debug_compositor from weston_compositor
This patch allows initialization of weston-debug/log framework much earlier than weston_compositor, which in turn will provide the option start logging before weston_compositor has been created. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
committed by
Daniel Stone
parent
bc137e345f
commit
880b485d76
+8
-1
@@ -2918,6 +2918,7 @@ int main(int argc, char *argv[])
|
||||
struct wl_listener primary_client_destroyed;
|
||||
struct weston_seat *seat;
|
||||
struct wet_compositor wet = { 0 };
|
||||
struct weston_debug_compositor *wdc = NULL;
|
||||
int require_input;
|
||||
sigset_t mask;
|
||||
|
||||
@@ -2961,6 +2962,12 @@ int main(int argc, char *argv[])
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
wdc = weston_debug_compositor_create();
|
||||
if (!wdc) {
|
||||
fprintf(stderr, "Failed to initialize weston debug framework.\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
weston_log_set_handler(vlog, vlog_continue);
|
||||
weston_log_file_open(log);
|
||||
|
||||
@@ -3025,7 +3032,7 @@ int main(int argc, char *argv[])
|
||||
backend = weston_choose_default_backend();
|
||||
}
|
||||
|
||||
wet.compositor = weston_compositor_create(display, &wet);
|
||||
wet.compositor = weston_compositor_create(display, wdc, &wet);
|
||||
if (wet.compositor == NULL) {
|
||||
weston_log("fatal: failed to create compositor\n");
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user