Skip to content

Migrate GTK click dispatch to FrameHitMap #449

Description

@JDonaghy

Summary

Replace handle_mouse_click_msg (~1,228 lines) and handle_mouse_drag_msg (~333 lines) with FrameHitMap::hit_test() for zone detection, then per-surface hit_test() methods for fine-grained resolution. Today vimcode manually computes pixel regions for every clickable surface; the new path gets zone identity from the cached FrameHitMap that ScreenLayout::draw() produces.

What exists in quadraui

  • FrameHitMap::hit_test(x, y) -> FrameZone — identifies which surface (Editor, TabBar, Palette, ContextMenu, etc.) contains the point
  • Per-surface hit-test methods already used by vimcode: CompletionsLayout::hit_test(), ContextMenuLayout::hit_test(), TerminalSplitLayout::hit_test(), EditorLayout::hit_test(), TabBarLayout::hit_test(), PaletteLayout::hit_test()
  • ShellContext::in_sidebar(x, y) / in_main(x, y) for panel zone detection

What to do

  1. Cache the FrameHitMap returned by ScreenLayout::draw() (Migrate GTK draw wiring to quadraui ScreenLayout::draw() #446)
  2. In mouse handlers, call hit_map.hit_test(x, y) to get the FrameZone
  3. Match on FrameZone variants to route to existing engine click handlers
  4. Delete manual pixel-region computation in handle_mouse_click_msg (~1,228 lines)
  5. Delete manual drag region tracking in handle_mouse_drag_msg (~333 lines)

Files

  • src/gtk/click.rs — simplify to FrameHitMap dispatch
  • src/gtk/mod.rs — delete handle_mouse_click_msg, handle_mouse_drag_msg

Dependencies

Notes

This is issue 4 of 4 in the GTK AppShell consumption series. Depends on #446. Much of the per-surface hit-test wiring already exists from the hit-test dedup sweep (Sessions 379-380); this issue consolidates the top-level zone detection layer.

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

    coordTracked by coord-tui pipelineenhancementNew feature or requestinfrastructureBuild, CI, distributionstatus:readyRefined and ready to enter the work pipeline

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions