Sun, 09 Jun 2024 16:26:28 +0200
fix eventdata not set by menu list events (GTK)
ui/gtk/menu.c | file | annotate | diff | comparison | revisions |
--- a/ui/gtk/menu.c Sun Jun 09 16:21:51 2024 +0200 +++ b/ui/gtk/menu.c Sun Jun 09 16:26:28 2024 +0200 @@ -292,13 +292,12 @@ gtk_widget_show(widget); if(list->callback) { - // TODO: use mempool UiEventData *event = malloc(sizeof(UiEventData)); event->obj = list->object; event->userdata = list->userdata; event->callback = list->callback; event->value = i - 1; - event->customdata = NULL; + event->customdata = elm; g_signal_connect( widget, @@ -324,7 +323,7 @@ evt.obj = event->obj; evt.window = event->obj->window; evt.document = event->obj->ctx->document; - evt.eventdata = NULL; + evt.eventdata = event->customdata; evt.intval = event->value; event->callback(&evt, event->userdata); }