Problem
The two terminal panel click handlers in src/gtk/mod.rs (~lines 6873 and 7575) manually compute term_y with ~20 lines of pixel arithmetic each, including a special-case snap for the maximized state. This must exactly match the draw function's layout (src/gtk/draw.rs ~line 503) or clicks land on the wrong zone.
The draw function already caches hit regions:
engine.bottom_tab_bar_hits — tab bar ("TERMINAL" / "DEBUG CONSOLE") hit zones
engine.terminal_toolbar_hits — toolbar button hit zones
The click handlers should read these cached regions instead of recomputing positions.
Proposed fix
Replace the manual term_y / zone computation in both click handlers with lookups into engine.bottom_tab_bar_hits and engine.terminal_toolbar_hits. This eliminates ~40 lines of bespoke pixel math and guarantees paint/click agreement by construction.
Context
Identified during #386 (extract compute_editor_layout). The PanelChromeDesc row-rounding disagrees with the draw function's pixel-exact maximize snapping — the cached hit regions sidestep this entirely.
Problem
The two terminal panel click handlers in
src/gtk/mod.rs(~lines 6873 and 7575) manually computeterm_ywith ~20 lines of pixel arithmetic each, including a special-case snap for the maximized state. This must exactly match the draw function's layout (src/gtk/draw.rs~line 503) or clicks land on the wrong zone.The draw function already caches hit regions:
engine.bottom_tab_bar_hits— tab bar ("TERMINAL" / "DEBUG CONSOLE") hit zonesengine.terminal_toolbar_hits— toolbar button hit zonesThe click handlers should read these cached regions instead of recomputing positions.
Proposed fix
Replace the manual
term_y/ zone computation in both click handlers with lookups intoengine.bottom_tab_bar_hitsandengine.terminal_toolbar_hits. This eliminates ~40 lines of bespoke pixel math and guarantees paint/click agreement by construction.Context
Identified during #386 (extract compute_editor_layout). The PanelChromeDesc row-rounding disagrees with the draw function's pixel-exact maximize snapping — the cached hit regions sidestep this entirely.