From de5e26b1282971b1631a7a6f3722056a9a48a4cf Mon Sep 17 00:00:00 2001 From: Nishi Date: Thu, 17 Sep 2026 03:21:27 +0900 Subject: [PATCH 1/4] fix --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 534614f..07f7bb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -497,7 +497,7 @@ configure_file( install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc - DESTINATION $ENV{MINGW_PREFIX}/${CMAKE_INSTALL_DATADIR}/pkgconfig + DESTINATION $ENV{MINGW_PREFIX}/${CMAKE_INSTALL_FULL_DATADIR}/pkgconfig ) if(MW_INSTALL_HEADERS) From 74054fba4b1590758d8afde29d0beff9742fd1e3 Mon Sep 17 00:00:00 2001 From: Nishi Date: Thu, 17 Sep 2026 03:36:00 +0900 Subject: [PATCH 2/4] fix --- src/draw.c | 3 +++ src/widget/document.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/draw.c b/src/draw.c index eb15c76..be82fb4 100644 --- a/src/draw.c +++ b/src/draw.c @@ -138,6 +138,9 @@ void MwDrawRectLine(MwWidget handle, MwRect* rect, MwLLColor color) { MwFixRect(&r); + r.width--; + r.height--; + p[0].x = r.x; p[0].y = r.y; diff --git a/src/widget/document.c b/src/widget/document.c index 55dd1f0..1f48cec 100644 --- a/src/widget/document.c +++ b/src/widget/document.c @@ -514,7 +514,7 @@ static void layout(MwWidget handle) { { int t = MwTextWidth(handle, TOPFONT, l->text); - if(x > 0) x += MwTextWidth(handle, TOPFONT, " "); + if(x > 0) x += MwTextWidth(handle, TOPFONT, "."); if((x + t) >= w) { x = 0; @@ -543,7 +543,7 @@ static void layout(MwWidget handle) { } case MwDOCUMENT_SPACE: { - x += MwTextWidth(handle, TOPFONT, " "); + x += MwTextWidth(handle, TOPFONT, "."); break; } case MwDOCUMENT_NEWLINE: From 7398604b7ca6bb56d4129b02448e40a488182d02 Mon Sep 17 00:00:00 2001 From: Nishi Date: Thu, 17 Sep 2026 03:38:11 +0900 Subject: [PATCH 3/4] unfix --- src/draw.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/draw.c b/src/draw.c index be82fb4..eb15c76 100644 --- a/src/draw.c +++ b/src/draw.c @@ -138,9 +138,6 @@ void MwDrawRectLine(MwWidget handle, MwRect* rect, MwLLColor color) { MwFixRect(&r); - r.width--; - r.height--; - p[0].x = r.x; p[0].y = r.y; From f9bbba8af9506952ed9317e1bdfea95babf0864a Mon Sep 17 00:00:00 2001 From: IoIxD Date: Wed, 16 Sep 2026 12:48:51 -0700 Subject: [PATCH 4/4] minor improvements on wayland --- .gitignore | 2 ++ include/Mw/LowLevel/Wayland.h | 13 ------------- src/backend/wayland/buffer.c | 13 +++++++++++++ src/backend/wayland/wayland.c | 33 +++++++-------------------------- 4 files changed, 22 insertions(+), 39 deletions(-) diff --git a/.gitignore b/.gitignore index 58b172a..3faccd3 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ compile_flags.txt *.finf *.gdb +flamegraph.svg +perf.* diff --git a/include/Mw/LowLevel/Wayland.h b/include/Mw/LowLevel/Wayland.h index 7a2c25c..3b79184 100644 --- a/include/Mw/LowLevel/Wayland.h +++ b/include/Mw/LowLevel/Wayland.h @@ -426,13 +426,9 @@ struct _MwLLWayland { MwBool force_render; MwBool did_event_loop_early; - MwBool do_cascading_draw; - int cascading_child_num; MwBool dispatching_resize; - MwBool is_toplevel_menu; - struct _MwLLWaylandShmBuffer framebuffer; struct _MwLLWaylandShmBuffer backbuffer; struct _MwLLWaylandShmBuffer cursor; @@ -440,15 +436,6 @@ struct _MwLLWayland { MwLLPixmap icon_pixmap; - pthread_mutex_t eventsMutex; - - int cancelEvent; - int numCallbacksRunning; - - uint32_t last_time; - - MwBool moving; - MwI64 keyboard_rate; MwI32 keyboard_delay; int last_pressed_key; diff --git a/src/backend/wayland/buffer.c b/src/backend/wayland/buffer.c index cb1eca5..48071ec 100644 --- a/src/backend/wayland/buffer.c +++ b/src/backend/wayland/buffer.c @@ -113,3 +113,16 @@ void MwLLWaylandBufferDestroy(struct _MwLLWaylandShmBuffer* buffer) { close(buffer->fd_back); buffer->setup = MwFALSE; } + +void MwLLWaylandBufferUpdate(MwLL self, struct _MwLLWaylandShmBuffer* buffer) { + if(self->wayland.configured) { + memcpy(buffer->buf, buffer->buf_back, buffer->buf_size); + if(buffer->surface) { + // Yes this is needed every time, it's how we fix weston. + if(self->wayland.configured) + wl_surface_attach(buffer->surface, buffer->shm_buffer, 0, 0); + + wl_surface_commit(buffer->surface); + } + } +} diff --git a/src/backend/wayland/wayland.c b/src/backend/wayland/wayland.c index bd17f84..9d8d634 100644 --- a/src/backend/wayland/wayland.c +++ b/src/backend/wayland/wayland.c @@ -218,19 +218,6 @@ static void xdg_surface_configure( self->wayland.configured = MwTRUE; } -void MwLLWaylandBufferUpdate(MwLL self, struct _MwLLWaylandShmBuffer* buffer) { - if(self->wayland.configured) { - memcpy(buffer->buf, buffer->buf_back, buffer->buf_size); - if(buffer->surface) { - // Yes this is needed every time, it's how we fix weston. - if(self->wayland.configured) - wl_surface_attach(buffer->surface, buffer->shm_buffer, 0, 0); - - wl_surface_commit(buffer->surface); - } - } -} - /* Toplevel setup function */ static void setup_toplevel(MwLL r, int x, int y) { char* mw_force_csd = getenv("MW_FORCE_CSD"); @@ -986,7 +973,7 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) { MwLL r; r = malloc(sizeof(*r)); memset(r, 0, sizeof(*r)); - pthread_mutex_init(&r->wayland.eventsMutex, NULL); + // pthread_mutex_init(&r->wayland.eventsMutex, NULL); MwLLCreateCommon(r); r->wayland.is_toplevel = parent == NULL; @@ -1015,8 +1002,6 @@ static void MwLLDestroyImpl(MwLL handle) { MwLLWaylandFlush(handle); - handle->wayland.cancelEvent = MwTRUE; - MwLLDestroyCommon(handle); tv.tv_sec = 0; @@ -1050,7 +1035,7 @@ static void MwLLDestroyImpl(MwLL handle) { printf("widget invalid\n"); } - pthread_mutex_destroy(&handle->wayland.eventsMutex); + // pthread_mutex_destroy(&handle->wayland.eventsMutex); free(handle); } @@ -1321,10 +1306,6 @@ static void MwLLEndDrawImpl(MwLL handle) { MwLLWaylandBufferUpdate(handle, &handle->wayland.backbuffer); } MwLLWaylandBufferUpdate(handle, &handle->wayland.framebuffer); - - if(handle->wayland.type != MwLL_WAYLAND_SUBLEVEL) { - handle->wayland.do_cascading_draw = 1; - } } } @@ -1382,16 +1363,16 @@ static int MwLLPendingImpl(MwLL handle) { handle->wayland.resizing = 0; + if(handle->wayland.type != MwLL_WAYLAND_SUBLEVEL) { + draw_children(handle); + frontbuffer_draw(handle); + } + if(handle->wayland.setting_wh) { actually_set_wh(handle); handle->wayland.setting_wh = 0; } - if(handle->wayland.do_cascading_draw) { - draw_children(handle); - frontbuffer_draw(handle); - } - handle->wayland.end_time = MwTimeGetTick(); if(handle->wayland.holding_key) {