From 117fa9cf925f11dcb27e14252827bc0f3a594002 Mon Sep 17 00:00:00 2001 From: Nishi Date: Sat, 12 Sep 2026 04:15:02 +0900 Subject: [PATCH 1/5] fix bug --- examples/basic/filechooser.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/basic/filechooser.c b/examples/basic/filechooser.c index 2637f86..6a86f98 100644 --- a/examples/basic/filechooser.c +++ b/examples/basic/filechooser.c @@ -5,13 +5,17 @@ MwWidget window; MwWidget button; MwWidget mb; +#ifdef BUG MwBool fpicker_wait = MwFALSE; MwBool msgbox_wait = MwFALSE; +#endif void MWAPI ok(MwWidget handle, void* user, void* call) { (void)handle; (void)call; +#ifdef BUG msgbox_wait = MwFALSE; +#endif } void MWAPI file_callback(MwWidget handle, void* user_data, void* call_data) { @@ -22,6 +26,7 @@ void MWAPI file_callback(MwWidget handle, void* user_data, void* call_data) { MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb); MwAddUserHandler(mb, MwNcloseHandler, ok, mb); +#ifdef BUG msgbox_wait = MwTRUE; while(msgbox_wait) { @@ -29,6 +34,7 @@ void MWAPI file_callback(MwWidget handle, void* user_data, void* call_data) { } fpicker_wait = MwFALSE; +#endif } void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) { @@ -42,6 +48,7 @@ void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) { MwSetText(fpicker, MwNbackground, MwGetInteger(fpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground); +#ifdef BUG fpicker_wait = MwTRUE; while(fpicker_wait) { @@ -50,6 +57,7 @@ void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) { MwDestroyWidget(fpicker); MwDestroyWidget(mb); +#endif } int main() { From b4545ed4e7b27bee997744c672a859910ab96928 Mon Sep 17 00:00:00 2001 From: IoIxD Date: Fri, 11 Sep 2026 12:52:20 -0700 Subject: [PATCH 2/5] accidentally rounded MwU16 to MwU8 in color picker --- src/dialog/colorpicker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dialog/colorpicker.c b/src/dialog/colorpicker.c index 95fc283..378b796 100644 --- a/src/dialog/colorpicker.c +++ b/src/dialog/colorpicker.c @@ -127,8 +127,8 @@ static void color_picker_image_update(color_picker_t* picker) { if(hue < 0.0) { hue += 360; } - hsv_v.h = (MwU8)((hue) * (HSV_HUE_STEPS / 360.)); - hsv_v.s = (MwU8)((dist) * (HSV_SAT_MAX / 180.)); + hsv_v.h = (MwU16)((hue) * (HSV_HUE_STEPS / 360.)); + hsv_v.s = (MwU16)((dist) * (HSV_SAT_MAX / 180.)); picker->hue_table[n] = hsv_v; picker->hue_table[n].generated = 1; } From 846bf551be6bcb649dc1b75c424d63b98bb9099b Mon Sep 17 00:00:00 2001 From: Nishi Date: Sat, 12 Sep 2026 04:53:02 +0900 Subject: [PATCH 3/5] fix some colors --- examples/basic/colorpicker.c | 6 ++++-- examples/basic/filechooser.c | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/basic/colorpicker.c b/examples/basic/colorpicker.c index dbce7fe..d02e357 100644 --- a/examples/basic/colorpicker.c +++ b/examples/basic/colorpicker.c @@ -35,12 +35,14 @@ int main() { window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL); - MwSetText(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultBackground : MwDefaultDarkBackground); + MwSetText(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground); + MwSetText(window, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground); button = MwVaCreateWidget(MwButtonClass, "button", window, 160, 180, 320, 120, MwNtext, "change window background", NULL); - MwSetText(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultBackground : MwDefaultDarkBackground); + MwSetText(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground); + MwSetText(button, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground); MwAddUserHandler(button, MwNactivateHandler, file_picker, NULL); diff --git a/examples/basic/filechooser.c b/examples/basic/filechooser.c index 6a86f98..6ad5636 100644 --- a/examples/basic/filechooser.c +++ b/examples/basic/filechooser.c @@ -64,13 +64,11 @@ int main() { MwLibraryInit(); window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, - MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL); - MwSetText(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultBackground : MwDefaultDarkBackground); + MwDEFAULT, 640, 480, MwNtitle, "file chooser", NULL); button = MwVaCreateWidget(MwButtonClass, "button", window, 160, 180, 320, 120, MwNtext, "select file", NULL); - MwSetText(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultBackground : MwDefaultDarkBackground); MwAddUserHandler(button, MwNactivateHandler, file_picker, NULL); From b02698b940c50b2275123642b8b25ba28d690181 Mon Sep 17 00:00:00 2001 From: IoIxD Date: Fri, 11 Sep 2026 13:09:11 -0700 Subject: [PATCH 4/5] fix menu positioning under weston --- src/backend/wayland/wayland.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/backend/wayland/wayland.c b/src/backend/wayland/wayland.c index 839e9ac..087f48b 100644 --- a/src/backend/wayland/wayland.c +++ b/src/backend/wayland/wayland.c @@ -180,6 +180,9 @@ static void xdg_toplevel_configure(void* data, if(self->wayland.type == MwLL_WAYLAND_TOPLEVEL) { if(width < 50) width = 50; if(height < 50) height = 50; + } else { + if(width < 1) width = 1; + if(height < 1) height = 1; } MwLLWaylandRegionInvalidate(self); @@ -281,7 +284,7 @@ static void setup_toplevel(MwLL r, int x, int y) { } /* check now if we have decorations so that everything else can act accordingly */ - if(shget(r->wayland.wl_protocol_map, zxdg_decoration_manager_v1_interface.name) != NULL) { + if(shget(r->wayland.wl_protocol_map, zxdg_decoration_manager_v1_interface.name) != NULL && getenv("MW_FORCE_CSD") == NULL) { r->wayland.has_decorations = MwTRUE; } else { r->wayland.do_csd = MwTRUE; @@ -524,7 +527,7 @@ static void setup_popup(MwLL r, int x, int y, MwLL parent) { } /* check now if we have decorations so that everything else can act accordingly */ - if(shget(r->wayland.wl_protocol_map, zxdg_decoration_manager_v1_interface.name) != NULL) { + if(shget(r->wayland.wl_protocol_map, zxdg_decoration_manager_v1_interface.name) != NULL && getenv("MW_FORCE_CSD") == NULL) { r->wayland.has_decorations = MwTRUE; } else { r->wayland.do_csd = MwTRUE; @@ -537,10 +540,10 @@ static void setup_popup(MwLL r, int x, int y, MwLL parent) { xdg_positioner_set_size(r->wayland.popup->xdg_positioner, r->wayland.ww, r->wayland.wh); xdg_positioner_set_anchor_rect( r->wayland.popup->xdg_positioner, - topmost_parent->wayland.x, topmost_parent->wayland.y, r->wayland.ww, r->wayland.wh); - xdg_positioner_set_offset( - r->wayland.popup->xdg_positioner, - r->wayland.x, r->wayland.y); + r->wayland.x, r->wayland.y, r->wayland.ww, r->wayland.wh); + // xdg_positioner_set_offset( + // r->wayland.popup->xdg_positioner, + // r->wayland.x, r->wayland.y); xdg_positioner_set_anchor(r->wayland.popup->xdg_positioner, XDG_POSITIONER_ANCHOR_NONE); xdg_positioner_set_gravity(r->wayland.popup->xdg_positioner, XDG_POSITIONER_GRAVITY_NONE); @@ -1120,6 +1123,9 @@ static void MwLLSetWHImpl(MwLL handle, int w, int h) { if(handle->wayland.type == MwLL_WAYLAND_TOPLEVEL) { if(w < 50) w = 50; if(h < 50) h = 50; + } else { + if(w < 1) w = 1; + if(h < 1) h = 1; } handle->wayland.ww = w; From 892f9198abe362fdac0ab0e878035a24c92f64af Mon Sep 17 00:00:00 2001 From: IoIxD Date: Fri, 11 Sep 2026 13:10:40 -0700 Subject: [PATCH 5/5] wayland: destroy popup surfaces at correct time --- src/backend/wayland/wayland.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/backend/wayland/wayland.c b/src/backend/wayland/wayland.c index 087f48b..34d2e13 100644 --- a/src/backend/wayland/wayland.c +++ b/src/backend/wayland/wayland.c @@ -584,14 +584,13 @@ static void setup_popup(MwLL r, int x, int y, MwLL parent) { /* Popup destroy function */ static void destroy_popup(MwLL r) { - MwLLWaylandBackbufferDestroy(&r->wayland); MwLLWaylandFramebufferDestroy(&r->wayland); - xdg_surface_destroy(r->wayland.popup->xdg_surface); - xdg_popup_destroy(r->wayland.popup->xdg_popup); + xdg_surface_destroy(r->wayland.popup->xdg_surface); + xdg_positioner_destroy(r->wayland.popup->xdg_positioner); wl_surface_destroy(r->wayland.framebuffer.surface);