+ /* 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);
+