-
fix(x): the hover companion stops eating the desktop around it (#883)
发布于
2026-08-21 08:50:01 +00:00 The companion frame is far bigger than anything it paints: a tall
transparent stage sits above the card so popovers can open upward without
resizing, and the tucked Skipper is just the mascot in that same frame. But
transparency is only PAINT — macOS routes a click to the topmost window by
its RECT, not by pixel alpha — so that stage swallowed every click that
landed on it: a ~500px square of dead desktop around the companion, and an
invisible drag area that moved the Skipper when you pressed on what looked
like empty space.The window is now created click-through and turns solid only while the
cursor is over something actually drawn. Main polls the cursor from the OS
and hands the point to the renderer, which hit-tests the DOM: mouse events
are not a witness we can use here, because on macOS a drag region is a
native view layered over the page, so moves across it never reach the
renderer at all — and the mascot IS the drag handle. Driven by events alone
it could be neither clicked nor dragged.The hit test is inverted on purpose: only the frame's own containers are
marked passthrough, so anything else under the cursor — including menus
portaled to , and anything added later — stays clickable by default.
Wrong in that direction costs a dead pixel; wrong the other way costs an
unclickable control. The mascot column is deliberately solid across its
whole 132px footprint, so the Skipper is still grabbable anywhere on it.Folding the card no longer resizes the window either. The frame is
bottom-right anchored, so shrinking a 504px square to a 225px one moved its
origin by 279px, and on a transparent window the OS frame change and
Chromium's repaint of the newly-sized viewport are not atomic — the mascot
was composited against the wrong geometry for a frame or two, flashing well
above where it lands. There is nothing left to shrink now that the space the
card vacates is click-through. The pill keeps its tuck resize: it folds to a
genuinely different layout, which only lands right in mascot-sized bounds.Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com
下载附件