This aligns the Windows platform implementation with a code style similar to macOS platform, eliminating most of the Cells and Mutexes. This adjustment facilitates potential future porting to a multi-threaded implementation if required.
Overall, this PR made the following changes: it segregated all member variables in WindowsPlatform and WindowsWindow, grouping together variables that remain constant throughout the entire app lifecycle, while placing variables that may change during app runtime into RefCell.
Edit:
During the code refactoring process, a bug was also fixed.
Before:
Close window when file has changed, nothing happen:
This aligns the Windows platform implementation with a code style similar to macOS platform, eliminating most of the
Cell
s andMutex
es. This adjustment facilitates potential future porting to a multi-threaded implementation if required.Overall, this PR made the following changes: it segregated all member variables in
WindowsPlatform
andWindowsWindow
, grouping together variables that remain constant throughout the entire app lifecycle, while placing variables that may change during app runtime intoRefCell
.Edit: During the code refactoring process, a bug was also fixed.
Before: Close window when file has changed, nothing happen:
https://github.com/zed-industries/zed/assets/14981363/0bcda7c1-808c-4b36-8953-a3a3365a314e
After: Now
should_close
callback is properly handledhttps://github.com/zed-industries/zed/assets/14981363/c8887b72-9a0b-42ad-b9ab-7d0775d843f5
Release Notes: