X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fcompositor.c;h=634c468aa1e14853152d9b8a7b0e9ee1308b64e1;hb=refs%2Fchanges%2F52%2F28052%2F2;hp=e03b860a74a3e8328e0f0b69dd6ea52dacef1913;hpb=f980c0d90329bf83a082c966d69b0015e34c218b;p=src%2Fagl-compositor.git diff --git a/src/compositor.c b/src/compositor.c index e03b860..634c468 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -73,6 +73,12 @@ to_ivi_compositor(struct weston_compositor *ec) return weston_compositor_get_user_data(ec); } +static void +sigint_helper(int sig) +{ + raise(SIGUSR2); +} + static void handle_output_destroy(struct wl_listener *listener, void *data) { @@ -321,6 +327,23 @@ parse_transform(const char *transform, uint32_t *out) return -1; } +static int +parse_activation_area(const char *geometry, struct ivi_output *output) +{ + int n; + unsigned width, height, x, y; + + n = sscanf(geometry, "%ux%u+%u,%u", &width, &height, &x, &y); + if (n != 4) { + return -1; + } + output->area_activation.width = width; + output->area_activation.height = height; + output->area_activation.x = x; + output->area_activation.y = y; + return 0; +} + static int configure_output(struct ivi_output *output) { @@ -344,6 +367,10 @@ configure_output(struct ivi_output *output) if (parse_transform(t, &transform) < 0) weston_log("Invalid transform \"%s\" for output %s\n", t, output->name); + weston_config_section_get_string(section, "activation-area", &t, ""); + if (parse_activation_area(t, output) < 0) + weston_log("Invalid activation-area \"%s\" for output %s\n", + t, output->name); free(t); } @@ -1625,6 +1652,7 @@ int wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_da struct weston_log_subscriber *logger; int ret = EXIT_FAILURE; bool xwayland = false; + struct sigaction action; const struct weston_option core_options[] = { { WESTON_OPTION_STRING, "backend", 'B', &backend }, @@ -1707,11 +1735,26 @@ int wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_da signals[0] = wl_event_loop_add_signal(loop, SIGTERM, on_term_signal, display); - signals[1] = wl_event_loop_add_signal(loop, SIGINT, on_term_signal, + signals[1] = wl_event_loop_add_signal(loop, SIGUSR2, on_term_signal, display); - signals[2] = wl_event_loop_add_signal(loop, SIGQUIT, on_term_signal, + signals[2] = wl_event_loop_add_signal(loop, SIGCHLD, sigchld_handler, display); + /* When debugging the compositor, if use wl_event_loop_add_signal() to + * catch SIGINT, the debugger can't catch it, and attempting to stop + * the compositor from within the debugger results in weston exiting + * cleanly. + * + * Instead, use the sigaction() function, which sets up the signal in a + * way that gdb can successfully catch, but have the handler for SIGINT + * send SIGUSR2 (xwayland uses SIGUSR1), which we catch via + * wl_event_loop_add_signal(). + */ + action.sa_handler = sigint_helper; + sigemptyset(&action.sa_mask); + action.sa_flags = 0; + sigaction(SIGINT, &action, NULL); + for (size_t i = 0; i < ARRAY_LENGTH(signals); ++i) if (!signals[i]) goto error_signals;