A deep technical dive into fixing window resize artifacts in Electron and Chromium on Windows. The investigation revealed two separate bugs in the DirectComposition rendering pipeline: asynchronous GPU operations causing viewport and clip rect desynchronization, and stale pixels appearing when frame sizes lagged behind window dimensions. The fixes involved painting transparent areas outside the viewport during resizes and adjusting viewport clipping to match received frame sizes, eliminating visual artifacts without performance penalties.

Table of contents
The bug What made this bug particularly interesting? Fixing the bug Narrowing down the root cause The crucial lead Locating the relevant Chromium component Locating the relevant viz code First bug Second bug Backporting the patches to Electron Thanks Final thoughts Sort: