aboutsummaryrefslogtreecommitdiff
path: root/swayidle
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2018-11-26 09:33:30 +0000
committerGitHub <noreply@github.com>2018-11-26 09:33:30 +0000
commit0ebb4107bc953aeaf07acd2258185879cf13f053 (patch)
tree2abcfc1918ad93194e3aec2d5d1bf7e490c2c83d /swayidle
parentc2921b2e613642ec147513607fb13d98ee43cee7 (diff)
parent814dc1dfe5bbfa47a0cfbcfe2c7dd7119b0bad7e (diff)
Merge pull request #3191 from emersion/fix-swayidle-busy-dispatch
swayidle: fix busy loop on writable FD
Diffstat (limited to 'swayidle')
-rw-r--r--swayidle/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/swayidle/main.c b/swayidle/main.c
index 89ccf671..dd7d9de3 100644
--- a/swayidle/main.c
+++ b/swayidle/main.c
@@ -192,8 +192,7 @@ static void setup_sleep_listener(void) {
acquire_sleep_lock();
struct wl_event_source *source = wl_event_loop_add_fd(state.event_loop,
- sd_bus_get_fd(bus), WL_EVENT_READABLE | WL_EVENT_WRITABLE,
- dbus_event, bus);
+ sd_bus_get_fd(bus), WL_EVENT_READABLE, dbus_event, bus);
wl_event_source_check(source);
}
#endif
@@ -401,10 +400,12 @@ static int display_event(int fd, uint32_t mask, void *data) {
count = wl_display_dispatch_pending(state.display);
wl_display_flush(state.display);
}
+
if (count < 0) {
wlr_log_errno(WLR_ERROR, "wl_display_dispatch failed, exiting");
sway_terminate(0);
}
+
return count;
}
@@ -462,7 +463,7 @@ int main(int argc, char *argv[]) {
wl_display_roundtrip(state.display);
struct wl_event_source *source = wl_event_loop_add_fd(state.event_loop,
- wl_display_get_fd(state.display), WL_EVENT_READABLE | WL_EVENT_WRITABLE,
+ wl_display_get_fd(state.display), WL_EVENT_READABLE,
display_event, NULL);
wl_event_source_check(source);