gpui: Allow the application to run after all windows are closed#36548
gpui: Allow the application to run after all windows are closed#36548Guibi1 wants to merge 2 commits intozed-industries:mainfrom
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @Guibi1 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
I’m curious why do you need this feature? AFAIK, on Windows pretty much all apps exit once the window is closed, unless they’ve got a tray icon like Steam. |
|
Exactly. Currently its impossible to do a system tray without running another event loop outside of gpui and doing an |
|
I found a way to add a tray icon if thats what you are looking for... however, exposing the event loop + adding a bunch more configurable options is needed (such as setting window visibility) |
…g when no windows are open
|
Hello! I think a better fix would be to remove the behavior from the GPUI platform entirely, so that all applications stay running after the last window is closed. Then we can re-implement this at the application level. |
…41436) This commit is a continuation of #36548. As per [mikayla-maki's Comment](#36548 (comment)), I removed the process management behavior located in GPUI and reimplemented it in Zed. Release Notes: - N/A --------- Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
|
I came here from search. For completness, here is example how to turn the feature on. This is not released in crates (version 0.2.2) yet, but it works like this in the branch. Application::new()
.with_quit_mode(QuitMode::Explicit)or Application::new().run(|cx: &mut App| {
cx.set_quit_mode(QuitMode::Explicit); |
…ed-industries#41436) This commit is a continuation of zed-industries#36548. As per [mikayla-maki's Comment](zed-industries#36548 (comment)), I removed the process management behavior located in GPUI and reimplemented it in Zed. Release Notes: - N/A --------- Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
This PR adds the option to prevent the event loop from exiting when the last window is closed by the user.
This is needs more thought because:
Release Notes: