compositor: Use stdint for specifing integer storage
[src/agl-compositor.git] / src / compositor.c
index 277a63b..078157a 100644 (file)
@@ -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)
 {
@@ -1503,7 +1520,8 @@ load_rdp_backend(struct ivi_compositor *ivi, int *argc, char **argv,
 }
 #else
 static int
-load_rdp_backend(struct ivi_compositor *ivi, int *argc, char **argv)
+load_rdp_backend(struct ivi_compositor *ivi, int *argc, char **argv,
+                enum weston_renderer_type renderer)
 {
        return -1;
 }
@@ -1827,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;
@@ -2033,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 },
@@ -2225,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);
@@ -2251,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])