Skip to content

GTK: replace native PopoverMenu context menus with quadraui ContextMenu primitive #395

Description

@JDonaghy

Problem

GTK backend uses native gtk4::PopoverMenu for explorer, tab, and editor right-click context menus instead of the quadraui ContextMenu primitive. This means:

  • ~200 lines of GTK-specific GIO action wiring in src/gtk/mod.rs (show_explorer_context_menu, handle_tab_right_click, show_action_menu_popover)
  • engine.handle_context_menu_key() is dead code on GTK — j/k nav and disabled-item skipping don't work
  • Cross-backend coverage table claims ContextMenu ✅/✅ but explorer/tab menus are actually native popovers

TUI already uses the engine ContextMenuState → quadraui ContextMenu path with full keyboard nav.

Current GTK flow

  1. Right-click → engine.open_*_context_menu() to build items
  2. Clone items, immediately engine.close_context_menu()
  3. Build native PopoverMenu with GIO SimpleAction wiring
  4. Native popover handles keyboard/mouse

Target flow

  1. Right-click → engine.open_*_context_menu() (same)
  2. GTK renders via quadraui ContextMenu primitive (quadraui GTK rasteriser already exists)
  3. Keyboard via engine.handle_context_menu_key() (same as TUI)

Files to change

  • src/gtk/mod.rs: remove show_explorer_context_menu (~100 lines), handle_tab_right_click (~80 lines), native popover wiring; render engine's context_menu through quadraui primitive instead
  • src/gtk/mod.rs: remove build_gio_menu_from_engine_items helper if it becomes unused

Context

Discovered during backend dedup audit (Session 373, #379). Quadraui confirms the GTK ContextMenu rasteriser is fully implemented (quadraui#175).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestinfrastructureBuild, CI, distributionuiUI/rendering

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions