gpui: Fix nested deferred support (#47770)

Release Notes:

- N/A

To fix crash when use `deferred` in a `deferred`.

```
thread 'main' (4024343) panicked at /Users/jason/.cargo/git/checkouts/zed-a70e2ad075855582/83ca310/crates/gpui/src/window.rs:2411:9:
assertion `left == right` failed: cannot call defer_draw during deferred drawing
  left: 1
 right: 0
```

### When we need use nested deferred?

#### Case 1

- A Popover (used `deferred`) with a form.
- An Input element in the Popover form.
- Input have ContextMenu that used `deferred`.
- User right click Input to open menu.


<img width="539" height="331" alt="image"
src="https://github.com/user-attachments/assets/98c03b1e-58fd-4863-8bcd-0141252d1c51"
/>

#### Case 2

- A Popover (`deferred`) with some content.
- There have a `info` icon in the content to show some tip by open
another Popover.

### Test by `examples/popover.rs`

<img width="916" height="373" alt="image"
src="https://github.com/user-attachments/assets/7ed6a511-6d60-40fb-837b-ebab8f0cba37"
/>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
5fb6eadc58Jason Lee committed on 3/19/2026, 5:01:56 PM· committed by GitHubparent0b557a5
2 files changedLine totals unavailable