Skip to content

fix: context menu z-order on canvas terminals#19

Merged
190km merged 3 commits intomainfrom
fix/context-menu-zorder
Mar 29, 2026
Merged

fix: context menu z-order on canvas terminals#19
190km merged 3 commits intomainfrom
fix/context-menu-zorder

Conversation

@190km
Copy link
Copy Markdown
Owner

@190km 190km commented Mar 29, 2026

Summary

  • Right-click context menus on canvas terminals were rendered behind overlapping terminal panels
  • Root cause: the shared paint layer used Order::Tooltip, which has higher priority than Order::Foreground where egui draws context menu popups
  • Fix: change the shared layer from Order::Tooltip to Order::Foreground — within the same Order, egui draws non-Area paint layers before Area layers (like context menu popups), so menus now render on top of panel fills

Test plan

  • Open multiple overlapping terminal panels on the canvas
  • Right-click on a terminal that is partially behind another terminal
  • Verify the context menu appears above all terminal panels
  • Verify terminal rendering (backgrounds, text, chrome) still looks correct at various zoom levels

190km added 3 commits March 29, 2026 21:57
Context menus were rendered behind overlapping terminal panels because
the shared paint layer used Order::Tooltip, which has higher priority
than Order::Foreground where context menus are drawn. Lowering the
shared layer to Order::Foreground ensures context menus render on top,
since egui draws non-Area paint layers before Area layers (like popups)
within the same Order.
- Keep terminal shared layer at Order::Tooltip for proper z-ordering
- Render context menu at Order::Debug (above Tooltip) using custom popup
- Store click position in canvas space so menu moves with pan/zoom
- Close menu on click-elsewhere
@190km 190km merged commit 862b706 into main Mar 29, 2026
8 checks passed
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.

1 participant