# Potential fix for \#2422 \(\#4197\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a1c4716eebc7afec8c5e80d5eba44f5758d778cc)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a1c4716eebc7afec8c5e80d5eba44f5758d778cc

Requested commit: a1c4716eebc7afec8c5e80d5eba44f5758d778cc

Commit: a1c4716eebc7afec8c5e80d5eba44f5758d778cc

Tree: 75512b66f8578c50885856de833e5b399db18202

Author: Conrad Irwin

Committer: GitHub

## Message

```
Potential fix for #2422 (#4197)

- it seems like layer.drawable_size() is 0,0 in metal_renderer.rs:189 
- we set this in two places:
    - in response to a CALayerDelegate setFrameSize: event
- in response to a CALayerDelegate viewDidChangeBackingProperties:
event.
- it looks like if we don't set it in either of these cases we get a
different failure mode: the view is zoomed just wrong.
- That said, I can reproduce the screenshot if .scale_factor() returns
0.
- This might happen if [nativeWindow screen] is nil, which happens when
the window is off screen.
    - possible that zed started with offscreen window?
- I would expect that viewDidChangeBackingProperties would fire when
that changed.
    - potential fix: default to 2.0

Release Notes:

- Fixed Zed occasionally rendering blank on laungh
([#2422](https://github.com/zed-industries/community/issues/2422)).
```

## Parents

- [e896941981c63484b91c871eec32cb39eed67c12](https://git.cafe/gitcafe/zed/commit/e896941981c63484b91c871eec32cb39eed67c12?format=markdown)

- [41a99c686b92f0138f3dd1e8eeaf8be399fcaa20](https://git.cafe/gitcafe/zed/commit/41a99c686b92f0138f3dd1e8eeaf8be399fcaa20?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a1c4716eebc7afec8c5e80d5eba44f5758d778cc?format=markdown)
