X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fcompositor.c;h=078157a06b69a9e4c26f0135e71e4deef7bfda5c;hb=HEAD;hp=d82676bb96150609294d9702df8cfaac91bd619e;hpb=8e20d1cb7626dc6cb5b7fbd61714d4ed76d0e1e9;p=src%2Fagl-compositor.git diff --git a/src/compositor.c b/src/compositor.c index d82676b..078157a 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -73,6 +73,16 @@ to_ivi_compositor(struct weston_compositor *ec) return weston_compositor_get_user_data(ec); } +void +ivi_process_destroy(struct wet_process *process, int status, bool call_cleanup) +{ + wl_list_remove(&process->link); + if (call_cleanup && process->cleanup) + process->cleanup(process, status, process->cleanup_data); + free(process->path); + free(process); +} + struct ivi_output_config * ivi_init_parsed_options(struct weston_compositor *compositor) { @@ -93,6 +103,13 @@ ivi_init_parsed_options(struct weston_compositor *compositor) return config; } +static void +screenshot_allow_all(struct wl_listener *l, struct weston_output_capture_attempt *att) +{ + att->authorized = true; +} + + static void sigint_helper(int sig) { @@ -1828,7 +1845,7 @@ log_timestamp(char *buf, size_t len) strftime(timestr, sizeof(timestr), "%H:%M:%S", brokendown_time); /* if datestr is empty it prints only timestr*/ - snprintf(buf, len, "%s[%s.%03li]", datestr, + snprintf(buf, len, "%s[%s.%03"PRIi64"]", datestr, timestr, (tv.tv_usec / 1000)); return buf; @@ -2034,6 +2051,7 @@ int wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_da bool xwayland = false; struct sigaction action; char *renderer = NULL; + struct wet_process *process, *process_tmp; const struct weston_option core_options[] = { { WESTON_OPTION_STRING, "renderer", 'r', &renderer }, @@ -2226,8 +2244,11 @@ int wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_da ivi_launch_shell_client(&ivi, "shell-client-ext", &ivi.shell_client_ext.client); - if (debug) - ivi_screenshooter_create(&ivi); + if (debug) { + weston_compositor_add_screenshot_authority(ivi.compositor, + &ivi.screenshot_auth, + screenshot_allow_all); + } ivi_agl_systemd_notify(&ivi); wl_display_run(display); @@ -2252,6 +2273,9 @@ error_compositor: ivi_policy_destroy(ivi.policy); + wl_list_for_each_safe(process, process_tmp, &ivi.child_process_list, link) + ivi_process_destroy(process, 0, false); + error_signals: for (size_t i = 0; i < ARRAY_LENGTH(signals); ++i) if (signals[i])