Commit cb29d19
committed
fix(screen-adapter): debounce resize handler to prevent black flicker on web
The window resize event listener was calling _updateFrame() synchronously on every resize event. During continuous window dragging, this triggered dozens of swapchain/backbuffer reallocations per second, each producing a blank frame.
This change:
- Adds _resizeTimeoutId field for debounce state tracking
- Debounces the resize handler using setTimeout with EVENT_TIMEOUT (200ms)
- Uncomments and enables the handleResizeEvent guard on the resize path
- Adds handleResizeEvent guard to the DPR matchMedia listener, which was previously bypassing it
Fixes: #191821 parent 411f98d commit cb29d19
1 file changed
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
390 | 397 | | |
391 | 398 | | |
392 | 399 | | |
| |||
439 | 446 | | |
440 | 447 | | |
441 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
442 | 452 | | |
443 | 453 | | |
444 | 454 | | |
445 | 455 | | |
446 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
447 | 460 | | |
448 | 461 | | |
449 | 462 | | |
| |||
0 commit comments