gpui: Fix hide, activate method on Windows to hide/show application (#18164)

Release Notes:

- N/A

Continue #18161 to fix `cx.hide`, `cx.activate` method on Windows to
hide/show application.

## After


https://github.com/user-attachments/assets/fe0070f9-7844-4c2a-b859-3e22ee4b8d22

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
Jason Lee
2024-09-30 23:20:24 -07:00
committed by GitHub
co-authored by Mikayla Maki
parent 8d795ff882
commit 72be8c5d14
2 changed files with 32 additions and 4 deletions
+12
View File
@@ -150,6 +150,18 @@ impl Render for WindowDemo {
)
.unwrap();
}))
.child(button("Hide Application", |cx| {
cx.hide();
// Restore the application after 3 seconds
cx.spawn(|mut cx| async move {
Timer::after(std::time::Duration::from_secs(3)).await;
cx.update(|cx| {
cx.activate(false);
})
})
.detach();
}))
}
}