Detach instead of exiting if all outputs go away

output-management
Andri Yngvason 2023-11-15 20:55:58 +00:00
parent e0bdf98112
commit 64497d9388
1 changed files with 8 additions and 2 deletions

View File

@ -150,6 +150,7 @@ static void client_detach_wayland(struct wayvnc_client* self);
static int blank_screen(struct wayvnc* self); static int blank_screen(struct wayvnc* self);
static bool wayland_attach(struct wayvnc* self, const char* display, static bool wayland_attach(struct wayvnc* self, const char* display,
const char* output); const char* output);
static void wayland_detach(struct wayvnc* self);
struct wl_shm* wl_shm = NULL; struct wl_shm* wl_shm = NULL;
struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf = NULL; struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf = NULL;
@ -309,9 +310,14 @@ static void registry_remove(void* data, struct wl_registry* registry,
output_destroy(out); output_destroy(out);
if (out == self->selected_output) { if (out == self->selected_output) {
if (self->start_detached) {
nvnc_log(NVNC_LOG_WARNING, "No fallback outputs left. Detaching...");
wayland_detach(self);
} else {
nvnc_log(NVNC_LOG_ERROR, "No fallback outputs left. Exiting..."); nvnc_log(NVNC_LOG_ERROR, "No fallback outputs left. Exiting...");
wayvnc_exit(self); wayvnc_exit(self);
} }
}
return; return;
} }