Skip to content

#449: Migrate GTK click dispatch to FrameHitMap - #571

Merged
JDonaghy merged 2 commits into
developfrom
issue-449-migrate-gtk-click-dispatch-to-framehitma
Jul 10, 2026
Merged

#449: Migrate GTK click dispatch to FrameHitMap#571
JDonaghy merged 2 commits into
developfrom
issue-449-migrate-gtk-click-dispatch-to-framehitma

Conversation

@JDonaghy

Copy link
Copy Markdown
Owner

Closes #449

Automated merge from the coordinator for assignment 633dec489e20 on issue #449.

Worker branch: issue-449-migrate-gtk-click-dispatch-to-framehitmadevelop.

JDonaghy and others added 2 commits July 10, 2026 20:00
…FrameHitMap

Uses quadraui::ScreenLayout::hit_map() (quadraui#425) to recover a
FrameHitMap from the same Editor/TabBar objects render_content already
paints, without a second backend draw pass. click::pixel_to_click_target
consults it first, falling back to render::screen_zone_hit_test's manual
rect-walk for breadcrumb/divider zones (no FrameZone equivalent) and for
the brief window before the first paint populates the cache.

Scoped narrowly to Editor+TabBar only: including per-window StatusBar in
the same hit map would have let it win over Editor for a window's bottom
status row (StatusBar pushed after Editor, last-drawn-wins hit_test),
changing top-level zone resolution for status-bar clicks. Dialog/
ContextMenu/Completions/etc. keep their existing cached Layout::hit_test()
resolution in the overlay-arbitration cascade, which already runs before
pixel_to_click_target and is unaffected.
…HitMap test coverage, fix TabBar idx offset bug

Addresses review findings on the #449 FrameHitMap migration:

- Confirmed `ScreenLayout::hit_map()` (quadraui#425) landed in the sibling
  quadraui checkout this repo actually path-depends on
  (../quadraui -> quadraui-fresh-560, commit c316f15). The prior
  request-changes review checked a stale, unrelated ~/src/quadraui clone
  that this repo's Cargo.toml does not resolve to. `cargo build --features
  gui` compiles clean.

- Added unit test coverage for `frame_zone_to_screen_zone` and the
  `frame_hit_map` branch of `pixel_to_click_target`, building a real
  `quadraui::FrameHitMap` via `ScreenLayout::hit_map()` from the same
  Editor/TabBar surface construction `render_content` uses, instead of
  only exercising the `screen_zone_hit_test` fallback.

- That new test coverage caught a real bug: `FrameZone::TabBar { idx }`
  carries the *global* surface index across the whole `ScreenLayout`
  (editors pushed first, tab bars after), but `cached_tab_bar_zones` was a
  plain `Vec` indexed 0.. per tab bar. Whenever at least one editor window
  was on screen (always), the index was off by the editor count and every
  tab-bar FrameHitMap lookup silently missed, falling back to
  `screen_zone_hit_test` without ever exercising the new dispatch path.
  Fixed by keying `cached_tab_bar_zones` by the real global surface index
  (a `HashMap<usize, (GroupId, Rect)>` instead of a `Vec`).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@JDonaghy
JDonaghy merged commit 165ceeb into develop Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate GTK click dispatch to FrameHitMap

1 participant