windows: Show error messages when zed failed to lanuch (#32537)

Now, if either `WindowsPlatform` or `BladeRenderer` fails to initialize,
a window will pop up to notify the user.


![image](https://github.com/user-attachments/assets/40fe7f1d-5218-4ee2-b4ec-0945fed2b743)


Release Notes:

- N/A
This commit is contained in:
张小白 2025-06-11 18:37:34 +08:00 committed by GitHub
parent 7d5a5d0984
commit a3cc063107
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 33 additions and 13 deletions

View file

@ -142,7 +142,11 @@ pub fn guess_compositor() -> &'static str {
#[cfg(target_os = "windows")]
pub(crate) fn current_platform(_headless: bool) -> Rc<dyn Platform> {
Rc::new(WindowsPlatform::new())
Rc::new(
WindowsPlatform::new()
.inspect_err(|err| show_error("Error: Zed failed to launch", err.to_string()))
.unwrap(),
)
}
pub(crate) trait Platform: 'static {