Clean up input managers and input backends separately

When inputs are disabled, managers may exist while backends don't.
pull/131/head
Andri Yngvason 2022-01-30 13:11:04 +00:00
parent e9e7c1a33f
commit ce183e82e5
1 changed files with 10 additions and 6 deletions

View File

@ -283,16 +283,20 @@ void wayvnc_destroy(struct wayvnc* self)
wl_shm_destroy(wl_shm); wl_shm_destroy(wl_shm);
if (self->keyboard_manager) { if (self->keyboard_backend.virtual_keyboard) {
zwp_virtual_keyboard_v1_destroy(self->keyboard_backend.virtual_keyboard); zwp_virtual_keyboard_v1_destroy(
zwp_virtual_keyboard_manager_v1_destroy(self->keyboard_manager); self->keyboard_backend.virtual_keyboard);
keyboard_destroy(&self->keyboard_backend); keyboard_destroy(&self->keyboard_backend);
} }
if (self->pointer_manager) { if (self->keyboard_manager)
zwlr_virtual_pointer_manager_v1_destroy(self->pointer_manager); zwp_virtual_keyboard_manager_v1_destroy(self->keyboard_manager);
if (self->pointer_backend.pointer)
pointer_destroy(&self->pointer_backend); pointer_destroy(&self->pointer_backend);
}
if (self->pointer_manager)
zwlr_virtual_pointer_manager_v1_destroy(self->pointer_manager);
if (self->screencopy.manager) if (self->screencopy.manager)
zwlr_screencopy_manager_v1_destroy(self->screencopy.manager); zwlr_screencopy_manager_v1_destroy(self->screencopy.manager);