Fix GTK4 MenuItem: only create custom widgets for POP_UP menus#79
Closed
Fix GTK4 MenuItem: only create custom widgets for POP_UP menus#79
Conversation
Co-authored-by: akurtakov <574788+akurtakov@users.noreply.github.com>
Co-authored-by: akurtakov <574788+akurtakov@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add implementation of SWT MenuItem with icon on GTK 4
Implement MenuItem icon support for GTK4 using custom widgets
Feb 8, 2026
Co-authored-by: akurtakov <574788+akurtakov@users.noreply.github.com>
Copilot
AI
changed the title
Implement MenuItem icon support for GTK4 using custom widgets
Fix GTK4 MenuItem: only create custom widgets for POP_UP menus
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GTK4 MenuItem implementation attempted to register custom widgets with all menu types, causing assertion failures:
Root Cause
GTK4 menu handles vary by style:
SWT.POP_UP→GtkPopoverMenu(widget)SWT.BAR→GtkPopoverMenuBar(different widget type)SWT.DROP_DOWN→GMenuModel(not a widget)Only
GtkPopoverMenuacceptsgtk_popover_menu_add_child().Changes
MenuItem.java line ~315: Gate custom widget creation on parent menu style:
Scope
Icon support now works for popup/context menus without errors. Menu bar and submenu icons remain unsupported (GTK4 architectural constraint - no widget handle access).
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
repo.eclipse.org/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.10-7/x64/bin/java /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.10-7/x64/bin/java --enable-native-access=ALL-UNNAMED -classpath /opt/hostedtoolcache/maven/3.9.12/x64/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/opt/hostedtoolcache/maven/3.9.12/x64/bin/m2.conf -Dmaven.home=/opt/hostedtoolcache/maven/3.9.12/x64 -Dlibrary.jansi.path=/opt/hostedtoolcache/maven/3.9.12/x64/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/eclipse.platform.swt/eclipse.platform.swt org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests -pl bundles/org.eclipse.swt(dns block)/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.10-7/x64/bin/java /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.10-7/x64/bin/java --enable-native-access=ALL-UNNAMED -classpath /opt/hostedtoolcache/maven/3.9.12/x64/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/opt/hostedtoolcache/maven/3.9.12/x64/bin/m2.conf -Dmaven.home=/opt/hostedtoolcache/maven/3.9.12/x64 -Dlibrary.jansi.path=/opt/hostedtoolcache/maven/3.9.12/x64/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/eclipse.platform.swt/eclipse.platform.swt org.codehaus.plexus.classworlds.launcher.Launcher clean install -DskipTests -pl bundles/org.eclipse.swt,binaries/org.eclipse.swt.gtk.linux.x86_64 -am(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.