--- a/ui/gtk/list.c Thu Nov 21 18:45:47 2024 +0100 +++ b/ui/gtk/list.c Tue Nov 26 10:02:04 2024 +0100 @@ -402,11 +402,7 @@ } // TODO: destroy callback - if(args.contextmenu) { - UIMENU menu = ui_contextmenu_create(args.contextmenu, obj, view); - ui_widget_set_contextmenu(view, menu); - } - + GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view)); if(args.multiselection) { gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); @@ -420,6 +416,11 @@ GTK_POLICY_AUTOMATIC); // GTK_POLICY_ALWAYS SCROLLEDWINDOW_SET_CHILD(scroll_area, view); + if(args.contextmenu) { + UIMENU menu = ui_contextmenu_create(args.contextmenu, obj, scroll_area); + ui_widget_set_contextmenu(scroll_area, menu); + } + UI_APPLY_LAYOUT1(current, args); current->container->add(current->container, scroll_area, FALSE);