gpui: Reconcile hover listeners after layout changes (#62335)
GPUI's declarative hover styles are recomputed from the current frame's hit test, but `on_hover` listeners previously updated only in response to mouse movement or the pointer leaving the window. When layout moved a different element beneath a stationary pointer, the new element looked hovered without receiving its hover-start callback. This change reconciles each hover listener against the current hit test during painting and defers transitions until after the paint cycle, when application callbacks can safely update state. Reconciliation pauses while a mouse press is pending so hover-only controls remain mounted between mouse-down and mouse-up. The regression coverage moves an element beneath and away from a stationary pointer and verifies both transitions. It also verifies that repainting during a stationary mouse press does not generate a spurious hover exit. Testing: - `cargo test -p gpui --lib` - `cargo fmt --check -p gpui` - `cargo check -p delta --bin delta` with Delta temporarily patched to the local GPUI checkout Release Notes: - Fixed hover interactions not updating when interface elements move beneath a stationary pointer.
C
Conrad Irwin committed
38ca9106c5306ef93e52c35643df015a27f15b72
Parent: 4ed3738
Committed by GitHub <noreply@github.com>
on 8/7/2026, 10:17:41 PM