Skip to content

Commit c5244c1

Browse files
committed
[Gtk4] Set proper MenuItem.section on destroy
Fixes many problems like the following on editor switching: ``` (Eclipse:326795): GLib-GIO-CRITICAL **: 13:57:51.527: g_menu_insert_item: assertion 'G_IS_MENU_ITEM (item)' failed (Eclipse:326795): GLib-GIO-CRITICAL **: 13:57:51.527: g_menu_remove: assertion '0 <= position && (guint) position < menu->items->len' failed ```
1 parent 4277d11 commit c5244c1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ void destroyWidget() {
762762
aboveSection.sectionItems.addAll(section.sectionItems);
763763

764764
for (MenuItem item : section.sectionItems) {
765+
item.section = aboveSection;
765766
OS.g_menu_insert_item(aboveSection.getSectionHandle(), aboveSection.sectionItems.indexOf(item), item.handle);
766767
}
767768

0 commit comments

Comments
 (0)