weston/compositor
Derek Foreman f32bcfef42 compositor: Use sigaction to trap SIGINT
signalfd interacts badly with gdb's signal trapping - when hitting
ctrl-c in a debugger attached to weston, weston will receive the
signal. This results in weston exiting cleanly when the intent
was to use gdb to interfere with its operation.

Trapping SIGINT was introduced in commit 50dc6989 which ensured we
would call wl_display_terminate() on SIGINT or SIGTERM to clean
up our socket.

Killing weston with SIGINT is quite common for several developers,
so it's important to preserve this clean shutdown behaviour, so
we can't naively stop trapping SIGINT entirely.

Instead, use the sigaction() function to trap SIGINT, and have
the SIGINT handler send weston SIGUSR2 (SIGUSR1 is already
used by xwayland). SIGUSR2 can be trapped in the proper wayland
way via wl_event_loop_add_signal(). This way we can properly
break our event loop and clean up on SIGINT, but we can also
have gdb intercept SIGINT.

There are other ways around this, but I'm hoping this one allows
people to continue using ctrl-c to stop weston, and doesn't
require additional project specific gdb knowledge.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2022-04-13 08:56:48 +00:00
..
cms-colord.c Use weston_compositor_add_destroy_listener_once() in plugins 2019-11-21 16:32:55 +00:00
cms-helper.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
cms-helper.h Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
cms-static.c Use weston_compositor_add_destroy_listener_once() in plugins 2019-11-21 16:32:55 +00:00
executable.c tests: add mechanism to change Weston's behavior when running certain tests 2020-10-27 11:21:55 +00:00
main.c compositor: Use sigaction to trap SIGINT 2022-04-13 08:56:48 +00:00
meson.build compositor: Add suggestion when colord is enabled but not LCMS 2021-02-12 12:13:28 +00:00
screen-share.c screen-share: Name the seat "screen-share" 2022-02-08 09:41:24 +02:00
systemd-notify.c Use weston_compositor_add_destroy_listener_once() in plugins 2019-11-21 16:32:55 +00:00
text-backend.c Fix crash on activating a text area without a real keyboard 2021-11-18 11:29:56 +02:00
weston-screenshooter.c screenshooter: rename some functions to avoid conflicts 2020-10-27 12:19:39 +00:00
weston.desktop Remove dbus-launch from weston.desktop 2017-01-18 12:21:57 +00:00
weston.h compositor: Move child_process_list from global to wet_compositor. 2021-07-06 18:46:09 +00:00
xwayland.c xwayland: Simplify HAVE_XWAYLAND_LISTENFD usage 2022-04-11 08:45:19 +03:00