You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, Tauri exits when all windows have been destroyed.
AFAIK this is preventable in 2 ways:
Call prevent_exit() on RunEvent::ExitRequested events.
Downside is that it prevents the process from being killed normally. Users have to force kill the app in task manager/activity monitor.
Prevent window close via prevent_close and hide windows instead on WindowEvent::CloseRequested.
Hiding windows comes with side effects and can't be used in all use cases.
Since both approaches come with downsides, it'd be good if there was an intuitive way to keep the process running when all windows are closed.
Source for RunEvent::ExitRequested being called when all windows are closed appears to be here.
Describe the solution you'd like
Add an additional param on RunEvent::ExitRequested event indicating whether it's due to all windows being closed. Currently it's not possible to discern whether the exit request originated from Tauri itself on window close or legitimate user interaction.
Alternatives considered
It's definitely hacky but the best solution I've got for now is to run a empty, hidden window in the background to prevent exit. Would love to have a better way of solving this!
Additional context
No response
The text was updated successfully, but these errors were encountered:
This is actually exactly what we used to have but it interferes with how the process can be killed. On both MacOS and Windows, it prevents the process from being killed normally and you have to "force kill" it to shut it down.
This is actually exactly what we used to have but it interferes with how the process can be killed. On both MacOS and Windows, it prevents the process from being killed normally and you have to "force kill" it to shut it down.
You're right. I added an "Exit" option to the right-click menu of the tray.
Describe the problem
By default, Tauri exits when all windows have been destroyed.
AFAIK this is preventable in 2 ways:
prevent_exit()
onRunEvent::ExitRequested
events.prevent_close
and hide windows instead onWindowEvent::CloseRequested
.Since both approaches come with downsides, it'd be good if there was an intuitive way to keep the process running when all windows are closed.
Source for
RunEvent::ExitRequested
being called when all windows are closed appears to be here.Describe the solution you'd like
Add an additional param on
RunEvent::ExitRequested
event indicating whether it's due to all windows being closed. Currently it's not possible to discern whether the exit request originated from Tauri itself on window close or legitimate user interaction.Alternatives considered
It's definitely hacky but the best solution I've got for now is to run a empty, hidden window in the background to prevent exit. Would love to have a better way of solving this!
Additional context
No response
The text was updated successfully, but these errors were encountered: