diff options
author | 2018-05-16 08:57:40 +0100 | |
---|---|---|
committer | 2018-05-16 08:57:40 +0100 | |
commit | c7c2e5357cee8b3a5d1ce7d2dcd000d51b417fd8 (patch) | |
tree | 1f0c68394b602bf4ca75a81dbc03b5867ae86d87 /swayidle | |
parent | Merge pull request #1986 from emersion/clip-title-texture (diff) | |
parent | swayidle: terminate if wl_display_dispatch failed (diff) | |
download | sway-c7c2e5357cee8b3a5d1ce7d2dcd000d51b417fd8.tar.gz sway-c7c2e5357cee8b3a5d1ce7d2dcd000d51b417fd8.tar.zst sway-c7c2e5357cee8b3a5d1ce7d2dcd000d51b417fd8.zip |
Merge pull request #1990 from martinetd/swayidle_terminate
swayidle: terminate when server died
Diffstat (limited to 'swayidle')
-rw-r--r-- | swayidle/main.c | 8 |
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) { | |||
340 | } | 340 | } |
341 | 341 | ||
342 | static int display_event(int fd, uint32_t mask, void *data) { | 342 | static int display_event(int fd, uint32_t mask, void *data) { |
343 | wl_display_dispatch(state.display); | 343 | if (mask & WL_EVENT_HANGUP) { |
344 | sway_terminate(0); | ||
345 | } | ||
346 | if (wl_display_dispatch(state.display) < 0) { | ||
347 | wlr_log_errno(L_ERROR, "wl_display_dispatch failed, exiting"); | ||
348 | sway_terminate(0); | ||
349 | }; | ||
344 | return 0; | 350 | return 0; |
345 | } | 351 | } |
346 | 352 | ||