Files
zed/crates
morgankrey b69bbc2e0e gpui: Fix RefCell panic in thermal/keyboard state callbacks (#49187)
The `on_thermal_state_change` and `on_keyboard_layout_change` callbacks
in `App::new_app()` called `borrow_mut()` unconditionally. These
callbacks are invoked asynchronously by macOS via dispatch queues when
the system's thermal or keyboard state changes, which can happen while
the app's RefCell is already borrowed during an update cycle, causing a
panic.

This change uses `try_borrow_mut()` instead. If the borrow fails
(because the app is already borrowed), the callback silently skips the
update - the state can be queried on the next frame.

Fixes [ZED-4WM](https://zed-dev.sentry.io/issues/ZED-4WM)
Closes #49181

Release Notes:

- Fixed a crash on macOS caused by thermal or keyboard layout state
changes occurring during UI updates.
2026-02-14 13:55:13 -06:00
..
2026-01-28 21:34:10 +00:00
2025-10-17 18:58:14 +00:00
2026-02-12 01:06:23 +00:00
2025-10-17 18:58:14 +00:00
2026-02-12 01:06:23 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2026-02-12 01:06:23 +00:00
2026-02-12 01:06:23 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2026-02-12 01:06:23 +00:00
2026-02-12 01:06:23 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2026-02-12 01:06:23 +00:00
2025-11-07 11:36:05 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00