From cb375fbcbf5ec80f6744a8c351e5eeb036f23099 Mon Sep 17 00:00:00 2001 From: IoI_xD Date: Thu, 23 Apr 2026 12:31:53 -0700 Subject: [PATCH] fix weston --- src/backend/wayland.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/backend/wayland.c b/src/backend/wayland.c index 8404792..fcfc309 100644 --- a/src/backend/wayland.c +++ b/src/backend/wayland.c @@ -56,11 +56,10 @@ static void undestroy(MwLL self) { if(is_destroyed(self)) { \ printf("[WARNING] Operation on invalid widget at line %d\n", __LINE__); \ return; \ - } \ - pthread_mutex_lock(&self->wayland.eventsMutex); + } /* Footer for WAYLAND_EVENT_OP_START */ -#define WAYLAND_EVENT_OP_END(self) pthread_mutex_unlock(&self->wayland.eventsMutex); +#define WAYLAND_EVENT_OP_END(self) /* Setup the framebuffer with the saved width/height */ static void framebuffer_setup(struct _MwLLWayland* wayland); @@ -485,6 +484,7 @@ static void pointer_enter(void* data, struct wl_pointer* wl_pointer, MwU32 seria curSurface = surface; self->wayland.pointer_serial = serial; + wl_pointer_set_cursor(self->wayland.pointer, self->wayland.pointer_serial, self->wayland.cursor.surface, 0, 0); WAYLAND_EVENT_OP_END(self); }; @@ -1257,7 +1257,8 @@ static void wl_shm_interface_destroy(struct _MwLLWayland* wayland, wayland_proto static void update_buffer(MwLL self, struct _MwLLWaylandShmBuffer* buffer) { memcpy(buffer->buf, buffer->buf_back, buffer->buf_size); // Yes this is needed every time, it's how we fix weston. - wl_surface_attach(buffer->surface, buffer->shm_buffer, 0, 0); + if(self->wayland.configured) + wl_surface_attach(buffer->surface, buffer->shm_buffer, 0, 0); wl_surface_commit(buffer->surface); } @@ -1950,9 +1951,6 @@ static void MwLLDestroyImpl(MwLL handle) { wl_flush(handle); handle->wayland.cancelEvent = MwTRUE; - while(pthread_mutex_trylock(&handle->wayland.eventsMutex)) { - printf("h\n"); - }; MwLLDestroyCommon(handle); @@ -2499,6 +2497,10 @@ static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) { WIDGET_CHECK(handle); + if(handle->wayland.parent) { + return; + } + if(handle->wayland.cursor.setup) { buffer_destroy(&handle->wayland.cursor); wl_surface_destroy(handle->wayland.cursor.surface);