fix eventdata not set by menu list events (GTK) newapi

Sun, 09 Jun 2024 16:26:28 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 09 Jun 2024 16:26:28 +0200
branch
newapi
changeset 287
5370ea7e45a2
parent 286
f6ca4bbbe2a6
child 288
c5e89affb2ea

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);    
 }

mercurial