#550: Unify GTK (absolute) vs TUI (content-relative) window-rect coordinate conventions - #583
Merged
JDonaghy merged 1 commit intoJul 16, 2026
Conversation
TUI computed window_rects (and everything derived from them — breadcrumb/tab-bar bounds, dividers, window rects) relative to the editor content area's own top-left, then re-added editor_left/menu_rows at ~40 draw and click-hit-test call sites in render_impl.rs and mouse.rs. GTK's window rects were already absolute. This asymmetry is why render::breadcrumb_draw_targets()/tab_bar_draw_targets() carried an origin_offset param that only TUI needed. - build_screen_for_tui now builds content_bounds at the editor area's real absolute origin (activity bar + sidebar, menu bar), matching GTK's convention, instead of always (0.0, 0.0). - Dropped the now-always-(0,0) origin_offset param from breadcrumb_draw_targets()/tab_bar_draw_targets(); updated both backends' call sites. - Removed every now-redundant editor_area.x/.y (render_impl.rs) and editor_left/menu_rows (mouse.rs) offset addition applied to window-rect-derived data — window/tab-bar/breadcrumb/divider bounds, click and hover hit-tests, scrollbar tracks, tab-drag geometry. screen_to_drop_group_bounds's TUI call sites pick a (0,0) vs. real origin drop_origin exactly like GTK's existing #515 fix, so split-mode tab-group-drop overlays don't double-count the origin. - quadraui's TUI-only draw_find_replace(..., editor_left) still expects a content-relative group_bounds internally (can't edit the quadraui repo from here); vimcode's wrapper now always passes 0 since group_bounds is absolute already, keeping that internal translation a no-op. mouse.rs's matching hit-test math updated identically. - Added two regression tests in tui_main::mouse::tests that build a real ScreenLayout via build_screen_for_tui with sidebar + menu bar visible (non-zero origin) and dispatch clicks at the painted absolute coordinates, verified to fail if the offset math regresses. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #550
Automated merge from the coordinator for assignment 5b412dfb58f9 on issue #550.
Worker branch:
issue-550-unify-gtk-absolute-vs-tui-content-relati→develop.