Skip to content

GTK debug panel: variable tree clicks land on row ~2 above the clicked one #211

Description

@JDonaghy

Repro

  1. Start a debug session in GTK (`vimcode`, F5 with a launch.json).
  2. Open the Variables / Locals tree in the debug sidebar.
  3. Click any item (especially deeper rows).

Observed: the click activates the item ~2 rows ABOVE the one under the cursor. Worse for items further down the list.

Suspected cause

Same pattern as #210 — the click handler computes `item_idx = (y / row_height).floor()` by hand, but the rasteriser's actual row positions don't match that math. Likely the section headers (Locals / Watch / etc.) are rendered with different row heights than the items they contain, and the click handler doesn't account for that variation.

Files

  • `src/gtk/draw.rs::draw_debug_sidebar` (or wherever the var tree is rendered)
  • `src/gtk/mod.rs` debug sidebar click handler
  • Engine-side: `Engine::dap_variables`, `Engine::dap_scope_groups`

Surfaced by

User smoke testing during #205 slice 8 (`caf62a8`) — different surface but same root cause as the menu-dropdown bug fixed in slice 6.

Likely fix

Either:

  1. Migrate the debug sidebar rendering to a shared primitive (TreeView or a new debug-specific layout) that owns the hit-test math — proper structural fix, similar to slice 6 / 8 pattern.
  2. Walk the same accumulator the rasteriser uses (variable per-row heights) and store hit zones for the click handler — bandaid.

Per #210, the structural fix is the right call once the sidebar render gets factored.

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

    bugSomething isn't workingplatformPlatform-specific (macOS, Windows, Linux)uiUI/rendering

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions