Window B (wing). Move this window beside the main window on your desktop, then drag the card across the gap between them.

Multi-window canvas world

I wanted to see if one interactive HTML card can straddle the bezel between two Chrome windows positioned in screen coordinates, keep taking input on whichever side holds most of it, and clip cleanly at the canvas edge. Drag the card across the gap below, or open a second window on desktop to span real window frames.

Window A (left) LIVE AUTHORITY
:: Drag card LIVE A
0% clipped
Window B (right) PEER MIRROR
AuthorityWindow A (100%)
Card world (x, y)0, 0
Edge clipinside viewport
Handoff routewaiting
Connected peerssplit mode (2 panes)
World topology Simulated bezel: two panes in one coordinate space.

Tap "Sample edge pixels" after moving the card across a canvas edge to inspect the clipped column.

Show the code screen projection, edge clipping and authority handoff
  1. Two drawable canvases sharing one card layout. Each pane holds a <form drawable>; the peer copy stays inert so Tab order stays single-tracked.
  2. Screen-space projection and edge-clipped draw. Each pane subtracts its world origin and calls 5-argument drawElementImage(el, x, y, w, h), even when x < 0 or x + w > width.
  3. Live DOM authority handoff at 50% overlap. Crossing the midpoint reparents the live form with moveBefore() in split mode, or syncs value, selection and focus over BroadcastChannel across windows.
  4. Tap-triggered edge-clipping pixel probe. Copies the drawable canvas with drawImage() into a plain willReadFrequently canvas before calling getImageData().

How it works

  1. One world coordinate space. In multi-window mode, each browser window turns its desktop position (window.screenX, window.screenY, estimated window chrome thickness and the canvas rect) into a rectangle in desktop CSS pixels. In split-bezel mode, the left pane starts at x = 0 and the right pane starts at leftWidth + bezelGap.
  2. Drawing past the edge. Both panes subtract their own viewport origin from the card's world position and call ctx.drawElementImage(card, localX, localY, cardW, cardH). When the card straddles the seam, the left canvas draws past its right edge and the right canvas draws from a negative localX.
  3. Authority handoff at 50%. Every move computes the card's overlap fraction in each viewport. Whichever side holds more than 50% of the card owns live input (not inert). The other side stays inert and mirrors the text, slider and click count so the protruding half matches pixel for pixel.
  4. moveBefore() versus BroadcastChannel. In split-bezel mode (one document), crossing 50% can reparent the live <form> between the two canvases with canvas.moveBefore() while keeping focus and selection intact. Across two real Chrome windows, each window has its own document, so state and caret selection travel over BroadcastChannel('hic-multi-window') instead.
  5. Screen topology on request. Clicking "Read screen topology" calls window.getScreenDetails() so you can see every attached display alongside both window rectangles. Nothing prompts on load.

Live checks

ResultExperimentDetail

Findings