diff --git a/backend/session/session.c b/backend/session/session.c index 48f4ab187..9a36dd953 100644 --- a/backend/session/session.c +++ b/backend/session/session.c @@ -36,6 +36,15 @@ static void handle_disable_seat(struct libseat *seat, void *data) { static int libseat_event(int fd, uint32_t mask, void *data) { struct wlr_session *session = data; + if (mask & (WL_EVENT_HANGUP | WL_EVENT_ERROR)) { + if (mask & WL_EVENT_ERROR) { + wlr_log(WLR_ERROR, "Failed to wait for libseat event"); + } else { + wlr_log(WLR_INFO, "Failed to wait for libseat event"); + } + wlr_session_destroy(session); + return 0; + } if (libseat_dispatch(session->seat_handle, 0) == -1) { wlr_log_errno(WLR_ERROR, "Failed to dispatch libseat"); wlr_session_destroy(session); diff --git a/render/allocator/shm.c b/render/allocator/shm.c index 2622f99aa..b5be7d014 100644 --- a/render/allocator/shm.c +++ b/render/allocator/shm.c @@ -23,6 +23,7 @@ static struct wlr_shm_buffer *shm_buffer_from_buffer( static void buffer_destroy(struct wlr_buffer *wlr_buffer) { struct wlr_shm_buffer *buffer = shm_buffer_from_buffer(wlr_buffer); + wlr_buffer_finish(wlr_buffer); munmap(buffer->data, buffer->size); close(buffer->shm.fd); free(buffer); diff --git a/render/allocator/udmabuf.c b/render/allocator/udmabuf.c index e0b01b70a..8a7109aa5 100644 --- a/render/allocator/udmabuf.c +++ b/render/allocator/udmabuf.c @@ -31,6 +31,7 @@ static bool buffer_get_dmabuf(struct wlr_buffer *wlr_buffer, struct wlr_dmabuf_a static void buffer_destroy(struct wlr_buffer *wlr_buffer) { struct wlr_udmabuf_buffer *buffer = wl_container_of(wlr_buffer, buffer, base); + wlr_buffer_finish(wlr_buffer); wlr_dmabuf_attributes_finish(&buffer->dmabuf); close(buffer->shm.fd); free(buffer); diff --git a/tinywl/Makefile b/tinywl/Makefile index a5cedfcc8..76c33bb31 100644 --- a/tinywl/Makefile +++ b/tinywl/Makefile @@ -19,7 +19,7 @@ xdg-shell-protocol.h: tinywl.o: tinywl.c xdg-shell-protocol.h $(CC) -c $< -g -Werror $(CFLAGS) -I. -DWLR_USE_UNSTABLE -o $@ tinywl: tinywl.o - $(CC) $^ $> -g -Werror $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@ + $(CC) $^ -g -Werror $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@ clean: rm -f tinywl tinywl.o xdg-shell-protocol.h diff --git a/types/wlr_virtual_pointer_v1.c b/types/wlr_virtual_pointer_v1.c index b867c8fb1..fed5790a9 100644 --- a/types/wlr_virtual_pointer_v1.c +++ b/types/wlr_virtual_pointer_v1.c @@ -134,8 +134,11 @@ static void virtual_pointer_axis_source(struct wl_client *client, if (pointer == NULL) { return; } - pointer->axis_event[pointer->axis].pointer = &pointer->pointer; - pointer->axis_event[pointer->axis].source = source; + int n_axis = sizeof(pointer->axis_event) / sizeof(pointer->axis_event[0]); + for (int i = 0; i < n_axis; i++) { + pointer->axis_event[i].pointer = &pointer->pointer; + pointer->axis_event[i].source = source; + } } static void virtual_pointer_axis_stop(struct wl_client *client, diff --git a/xcursor/xcursor.c b/xcursor/xcursor.c index b5edb9de8..6627fb6cd 100644 --- a/xcursor/xcursor.c +++ b/xcursor/xcursor.c @@ -602,7 +602,7 @@ xcursor_build_fullname(const char *dir, const char *subdir, const char *file) static const char * xcursor_next_path(const char *path) { - char *colon = strchr(path, ':'); + const char *colon = strchr(path, ':'); if (!colon) return NULL;