diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c index e57cfed9..9623a168 100644 --- a/backend/wayland/backend.c +++ b/backend/wayland/backend.c @@ -6,6 +6,7 @@ #include #include "backend/wayland.h" #include "common/log.h" +#include "types.h" #include #include @@ -79,6 +80,12 @@ static void wlr_wl_backend_destroy(struct wlr_backend_state *state) { wlr_output_destroy(state->outputs[i]); } + for (size_t i = 0; state->devices && i < state->devices->length; ++i) { + wlr_input_device_destroy(state->devices->items[i]); + } + + list_free(state->devices); + wlr_egl_free(&state->egl); free(state->outputs); if (state->seat) wl_seat_destroy(state->seat); diff --git a/backend/wayland/output.c b/backend/wayland/output.c index 3ec167bc..32f2deae 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -83,7 +83,9 @@ static bool wlr_wl_output_move_cursor(struct wlr_output_state *output, } static void wlr_wl_output_destroy(struct wlr_output_state *output) { - // TODO: free egl surface + if(output->frame_callback) wl_callback_destroy(output->frame_callback); + eglDestroySurface(output->backend->egl.display, output->surface); + wl_egl_window_destroy(output->egl_window); wl_shell_surface_destroy(output->shell_surface); wl_surface_destroy(output->surface); free(output); diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c index d56f7d74..240cbbb0 100644 --- a/backend/wayland/wl_seat.c +++ b/backend/wayland/wl_seat.c @@ -61,6 +61,7 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, } wlr_device->pointer = wlr_pointer_create(NULL, NULL); + list_add(state->devices, wlr_device); wl_signal_emit(&state->backend->events.input_add, wlr_device); } if ((caps & WL_SEAT_CAPABILITY_KEYBOARD)) { @@ -75,6 +76,7 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, } wlr_device->keyboard = wlr_keyboard_create(NULL, NULL); + list_add(state->devices, wlr_device); wl_signal_emit(&state->backend->events.input_add, wlr_device); }