aboutsummaryrefslogtreecommitdiff
path: root/swayidle/main.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-05-16 08:57:40 +0100
committerGitHub <noreply@github.com>2018-05-16 08:57:40 +0100
commitc7c2e5357cee8b3a5d1ce7d2dcd000d51b417fd8 (patch)
tree1f0c68394b602bf4ca75a81dbc03b5867ae86d87 /swayidle/main.c
parent76bdbe938f2e59da2f8685637b8d2073487c405b (diff)
parent3b7cae0e31395d3515c75be1563be3de9373281a (diff)
Merge pull request #1990 from martinetd/swayidle_terminate
swayidle: terminate when server died
Diffstat (limited to 'swayidle/main.c')
-rw-r--r--swayidle/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/swayidle/main.c b/swayidle/main.c
index 60235280..ad9c84c9 100644
--- a/swayidle/main.c
+++ b/swayidle/main.c
@@ -340,7 +340,13 @@ void sig_handler(int signal) {
}
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;
}