Merge pull request #1990 from martinetd/swayidle_terminate

swayidle: terminate when server died
This commit is contained in:
emersion 2018-05-16 08:57:40 +01:00 committed by GitHub
commit c7c2e5357c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -340,7 +340,13 @@ void sig_handler(int signal) {
} }
static int display_event(int fd, uint32_t mask, void *data) { static int display_event(int fd, uint32_t mask, void *data) {
wl_display_dispatch(state.display); if (mask & WL_EVENT_HANGUP) {
sway_terminate(0);
}
if (wl_display_dispatch(state.display) < 0) {
wlr_log_errno(L_ERROR, "wl_display_dispatch failed, exiting");
sway_terminate(0);
};
return 0; return 0;
} }