Fix SIGUSR1 handling

Calling ev_break() in a signal handler doesn't work. Instead, we setup a
libev ev_signal handler for this.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2018-11-26 23:56:55 +00:00
parent b89dadec40
commit 531aafabb5
2 changed files with 37 additions and 30 deletions

View File

@ -435,6 +435,7 @@ typedef struct _latom {
#define REG_DATA_INIT { NULL, 0 }
typedef struct ev_session_signal ev_session_signal;
typedef struct ev_session_timer ev_session_timer;
typedef struct ev_session_idle ev_session_idle;
typedef struct ev_session_prepare ev_session_prepare;
@ -755,6 +756,8 @@ typedef struct session {
/// so we can be sure if xcb read from X socket at anytime during event
/// handling, we will not left any event unhandled in the queue
ev_session_prepare *event_check;
/// Signal handler for SIGUSR1
ev_session_signal *usr1_signal;
/// Whether we have hit unredirection timeout.
bool tmout_unredir_hit;
/// Whether we need to redraw the screen