touch-calibration: Clean-up if touch calibrator has been enabled

Seems that we're still missing layer clean-ups, with the touch
calibrator being one of them. Call the appropriate function when
shutting down the compositor instance.

Fixes: #603

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad
2022-04-07 20:04:25 +03:00
committed by Pekka Paalanen
parent 8aa1c30bf1
commit 3bedb70454
3 changed files with 15 additions and 0 deletions
+3
View File
@@ -7852,6 +7852,9 @@ weston_compositor_shutdown(struct weston_compositor *ec)
wl_event_source_remove(ec->idle_source); wl_event_source_remove(ec->idle_source);
wl_event_source_remove(ec->repaint_timer); wl_event_source_remove(ec->repaint_timer);
if (ec->touch_calibration)
weston_compositor_destroy_touch_calibrator(ec);
/* Destroy all outputs associated with this compositor */ /* Destroy all outputs associated with this compositor */
wl_list_for_each_safe(output, next, &ec->output_list, link) wl_list_for_each_safe(output, next, &ec->output_list, link)
output->destroy(output); output->destroy(output);
+2
View File
@@ -389,6 +389,8 @@ const uint64_t *
weston_drm_format_get_modifiers(const struct weston_drm_format *format, weston_drm_format_get_modifiers(const struct weston_drm_format *format,
unsigned int *count_out); unsigned int *count_out);
void
weston_compositor_destroy_touch_calibrator(struct weston_compositor *compositor);
/** /**
* paint node * paint node
* *
+10
View File
@@ -674,6 +674,16 @@ bind_touch_calibration(struct wl_client *client,
} }
} }
void
weston_compositor_destroy_touch_calibrator(struct weston_compositor *ec)
{
/* TODO: handle weston_compositor::touch_calibrator destruction
* see
* https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/819#note_1345191
*/
weston_layer_fini(&ec->calibrator_layer);
}
/** Advertise touch_calibration support /** Advertise touch_calibration support
* *
* \param compositor The compositor to init for. * \param compositor The compositor to init for.