# HG changeset patch
# User Olaf Wintermann <olaf.wintermann@gmail.com>
# Date 1717943188 -7200
# Node ID 5370ea7e45a21e3004a3ed3e0f810778e446580c
# Parent  f6ca4bbbe2a6f1076e7d2d2f93cf347722713ceb
fix eventdata not set by menu list events (GTK)

diff -r f6ca4bbbe2a6 -r 5370ea7e45a2 ui/gtk/menu.c
--- 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);    
 }