swaynag: exit on wl_display_roundtrip error

fixes loop when sway closes the socket in the middle of querying outputs,
see #5138.
This commit is contained in:
Dominique Martinet 2020-03-29 10:09:29 +02:00 committed by Simon Ser
parent ac3444295d
commit 284dcb2dc7
1 changed files with 5 additions and 1 deletions

View File

@ -444,7 +444,11 @@ void swaynag_setup(struct swaynag *swaynag) {
assert(swaynag->compositor && swaynag->layer_shell && swaynag->shm);
while (swaynag->querying_outputs > 0) {
wl_display_roundtrip(swaynag->display);
if (wl_display_roundtrip(swaynag->display) < 0) {
sway_log(SWAY_ERROR, "Error during outputs init.");
swaynag_destroy(swaynag);
exit(EXIT_FAILURE);
}
}
if (!swaynag->output && swaynag->type->output) {