gpui: Read thermal state from window handle (#49847) (cherry-pick to preview) (#49991)
zed-zippy[bot]
and
Marco Mihai Condrache
created
Cherry-pick of #49847 to preview
----
Should close #49566
Inside `on_request_frame`, it’s conceptually incorrect to update the
application directly. Instead, we should read the thermal state through
the window handle, just like in the rest of the callback. That path uses
`try_borrow_mut` internally, so if the application is already being
updated elsewhere, we can safely skip checking the thermal state for
that frame and retry on the next one.
Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Co-authored-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>