This contains two changes in order to hopefully avoid the panic we saw
in #panics:
```
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value'
crates/gpui/src/platform/mac/display.rs:30
<backtrace::capture::Backtrace as core::fmt::Debug>::fmt
<backtrace::capture::Backtrace as core::fmt::Debug>::fmt
Zed::init_panic_hook::{closure#0}
std::panicking::rust_panic_with_hook
std::panicking::rust_panic_with_hook
std::sys_common::backtrace::output_filename
<std::panicking::begin_panic_handler::FormatStringPayload as core::panic::PanicPayload>::take_box
core::panicking::panic_fmt
core::panicking::panic
gpui::platform::mac::display::display_bounds_to_native
<gpui::platform::mac:🪟:MacWindow as gpui::platform::PlatformWindow>::bounds
<gpui:🪟:WindowContext>::window_bounds_changed
<gpui:🪟:Window>:🆕:{closure#1}
gpui::platform::mac:🪟:view_did_change_backing_properties
<gpui::platform::mac::platform::MacPlatform as gpui::platform::Platform>::run
Zed::main
<core::marker::PhantomData<core::option::Option<Zed::LocationData>> as serde:🇩🇪:DeserializeSeed>::deserialize::<&mut serde_json:🇩🇪:Deserializer<serde_json::read::StrRead>>
workspace::open_new::<Zed::restore_or_create_workspace::{closure#0}::{closure#0}::{closure#0}::{closure#2}::{closure#0}>::{closure#0}::{closure#0}
std::rt::lang_start_internal
serde_json:🇩🇪:from_trait::<serde_json::read::StrRead, core::option::Option<Zed::Panic>>
```
Two changes:
* Reduce the number of calls to `CGGetActiveDisplayList` in the hopes
that this will also reduce chances of it returning an empty list.
Previously, in the worst case, we called it 6 times. Now the worst case
is that we call it 3 times.
* Instead of calling `CGGetActiveDisplayList` to get the primary display
we do what Chromium does and construct the primary display from
NSScreen.
Release Notes:
- Fixed a bug that caused a panic that could happen when Zed attempted
to render on a sleeping display.
According to Chromium source, `NSScreen::screens` should always get us
one display.
We made this change because we ran into panics caused by the previous
`unwrap()` when `CGGetActiveDisplayList` might return an empty list.
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.
Fixes `[2024-01-16T09:21:54Z ERROR util]
crates/theme/src/settings.rs:172: theme not found: One Light` error from
the log after
d84785f7e8
Release Notes:
- N/A
Now that views are cached, we need to explicitly `.notify()` text
editors when the buffer font size changes.
* [x] Notify editors when settings change, or adjusting buffer font size
* [x] Figure out why non-focused editors still do not re-render when
adjusting buffer font size
* [x] Reset buffer font size adjustment when the size is updated in the
user's settings
As this is used if you mis-spell "buffer_font_family", it should be
monospace.
Also treat "Zed Mono" and "Zed Sans" as valid fonts
Follow up to #4045
Release Notes:
- Fixes font validation to allow "Zed Mono" as a valid font
Release Notes:
- Fixed a bug where the 'deafen' button would only apply to audio from
the call's current participants, but not any participants who joined
after the button was pressed.
- Fixed a bug where after being granted write access to a channel, the
microphone icon appeared non-muted, even though audio was not shared.
A sequence of events: Launch Zed -> Quit Zed -> Launch Zed would leave
you with a project panel in a a different state on each open (e.g. if it
is open on 1st one, 2nd run will have it closed). We were essentially
not tracking whether the deserialization took place.
Release Notes:
- Fixed project panel being toggled on/off on startup due to incorrect
tracking of serialization state (solves
https://github.com/zed-industries/community/issues/2406)
Also prevent tabs from being added in readonly editors
Release Notes:
- Fixed LSP logs being inserted into the editor incorrectly
- Fixed `editor::Tab` action inserting tabs in read-only files
This PR renames the `h_stack` and `v_stack` to `h_flex` and `v_flex`,
respectively.
We were previously using `h_stack` and `v_stack` to match SwiftUI, but
`h_flex` and `v_flex` fit better with the web/flexbox terminology that
the rest of GPUI uses.
Additionally, we were already calling the utility functions used to
implement `h_stack` and `v_stack` by the new names.
Release Notes:
- N/A
This was causing the Metal shaders to incorrectly interpret the
primitives submitted by GPUI, which in turn caused rendering to be
completely borked.
Release Notes:
- N/A
Honestly thought this was a bug with our terminal port lol. Turns out
its an oversight in the `dialoguer` crate but its seems pretty easy to
work around so might as well
Release Notes:
- N/A