Handle SIGINT through libev

Handle SIGINT using libev's ev_signal handler, instead of using
sigaction().

Fixes #64. But compton might miss signals when it's not in the main loop
(e.g. when compton is reset), and thus not exit "clearly". It should
cause any real problem though, so we don't care.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-02-11 23:13:39 +00:00
parent df69749804
commit 7a21cef9a4
2 changed files with 14 additions and 14 deletions

View File

@ -311,6 +311,8 @@ typedef struct session {
ev_prepare event_check;
/// Signal handler for SIGUSR1
ev_signal usr1_signal;
/// Signal handler for SIGINT
ev_signal int_signal;
/// backend data
void *backend_data;
/// libev mainloop