nvm
Some checks are pending
pyrite-dev/milsko/pipeline/head Build started...

This commit is contained in:
IoIxD 2026-09-26 15:48:11 -07:00
commit 2d992362b4

View file

@ -117,8 +117,9 @@ static void click(MwWidget handle) {
if(MwGetInteger(handle, MwNleftPadding) <= handle->mouse_point.x && rc.y <= handle->mouse_point.y && handle->mouse_point.y <= (int)(rc.y + rc.height)) {
if(menu->sub[i]->wsub == NULL && arrlen(menu->sub[i]->sub) > 0) {
MwPoint p;
int j;
MwPoint p;
MwWidget sw;
int j;
for(j = 0; j < arrlen(menu->sub); j++) {
if(menu->sub[j]->wsub != NULL) MwDestroyWidget(menu->sub[j]->wsub);
@ -128,8 +129,14 @@ static void click(MwWidget handle) {
p.x = MwGetInteger(handle, MwNwidth);
p.y = rc.y - 3;
menu->sub[i]->wsub = MwCreateWidget(MwSubMenuClass, "submenu", handle, 0, 0, 0, 0);
MwSubMenuAppear(menu->sub[i]->wsub, menu->sub[i], &p, 0);
/* some backends (e.g. Wayland) dispatch input while creating a widget, which can re-enter this handler */
sw = MwCreateWidget(MwSubMenuClass, "submenu", handle, 0, 0, 0, 0);
if(sw != NULL && (menu->sub[i]->wsub != NULL || handle->destroyed)) {
MwDestroyWidget(sw);
} else if(sw != NULL) {
menu->sub[i]->wsub = sw;
MwSubMenuAppear(sw, menu->sub[i], &p, 0);
}
i = -1;
} else if(menu->sub[i]->wsub != NULL && arrlen(menu->sub[i]->sub) > 0) {
while(w->parent->widget_class == MwSubMenuClass) w = w->parent;