# Call CGGetActiveDisplayList once to avoid panic · gitcafe/zed

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

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

Visibility: public

Requested revision: 03bfe3ef80eb2f2af6932f6f0f9117a430328ecd

Requested commit: 03bfe3ef80eb2f2af6932f6f0f9117a430328ecd

Commit: 03bfe3ef80eb2f2af6932f6f0f9117a430328ecd

Tree: 06775039aafb2b4e2acb91b1778af112e2ab14cb

Author: Thorsten Ball

Committer: Thorsten Ball

## Message

```
Call CGGetActiveDisplayList once to avoid panic

Previously we called CGGetActiveDisplayList twice: once to get the
number of displays and then to get the displays.

We saw a panic due to no displays being returned here. As a first
attempt to fix the panic, we're reducing the amount of calls to
CGGetActiveDisplayList and just do one with the trade-off being that we
pre-allocate 32 pointers in a Vec.

```

## Parents

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

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