Skip to content

Migrate GTK draw wiring to quadraui ScreenLayout::draw() #446

Description

@JDonaghy

Summary

Replace src/gtk/draw.rs surface-by-surface delegation (~3,874 lines) with quadraui's declarative ScreenLayout::draw() + FrameHitMap. Today each surface is individually positioned, measured, and drawn via a separate call; the new path pushes Surface entries in z-order and calls .draw(backend) once.

What exists in quadraui

  • quadraui::ScreenLayout — push Surface entries (Editor, TabBar, StatusBar, Palette, ContextMenu, etc.) in back-to-front z-order
  • ScreenLayout::draw(&self, backend: &mut dyn Backend) -> FrameHitMap — renders all surfaces, returns hit map
  • FrameHitMap::hit_test(x, y) -> FrameZone — highest-z zone at point (consumed by fix: dedupe terminal pane focus + selection into engine method (#429) #445)
  • Proven in gtk_frame_demo / tui_frame_demo examples

What to do

  1. Build a quadraui::ScreenLayout in vimcode's GTK draw path, pushing each surface with its rect
  2. Call .draw(backend) instead of individual draw_* calls
  3. Cache the returned FrameHitMap for click dispatch (fix: dedupe terminal pane focus + selection into engine method (#429) #445)
  4. Delete the per-surface draw wiring in src/gtk/draw.rs

Files

  • src/gtk/draw.rs — bulk of the deletion (~3,874 lines → near-zero)
  • src/render.rs — may need to produce Surface entries instead of / alongside current ScreenLayout struct

Dependencies

Notes

vimcode has its own render::ScreenLayout struct — naming collision with quadraui::ScreenLayout. Will need a qualified import or rename.

This is issue 1 of 4 in the GTK AppShell consumption series. Should land before #445 (click dispatch migration).

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

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions