From 4f1bca55c3bf19a58e9d892a5141fdfc5159bf01 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Fri, 12 Jun 2020 23:15:22 +0000 Subject: [PATCH] Exit when main selected seat/output goes away --- src/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 18576dc..f7d0cd1 100644 --- a/src/main.c +++ b/src/main.c @@ -212,7 +212,10 @@ static void registry_remove(void* data, struct wl_registry* registry, wl_list_remove(&out->link); output_destroy(out); - /* TODO: If this is the selected output, exit */ + if (out == self->selected_output) { + log_error("Selected output went away. Exiting...\n"); + wayvnc_exit(self); + } return; } @@ -222,7 +225,10 @@ static void registry_remove(void* data, struct wl_registry* registry, wl_list_remove(&seat->link); seat_destroy(seat); - /* TODO: If this is the selected seat, exit */ + if (seat == self->selected_seat) { + log_error("Selected seat went away. Exiting...\n"); + wayvnc_exit(self); + } return; }