Save open files on window focus loss
This commit is contained in:
@@ -27,6 +27,7 @@ public partial class IdeWindow : Control
|
||||
MSBuildLocator.RegisterDefaults();
|
||||
GodotServiceDefaults.AddServiceDefaults();
|
||||
Singletons.AppState = AppStateLoader.LoadAppStateFromConfigFile();
|
||||
GetWindow().FocusExited += OnFocusExited;
|
||||
//GetWindow().SetMinSize(new Vector2I(1152, 648));
|
||||
Callable.From(() => PickSolution(true)).CallDeferred();
|
||||
}
|
||||
@@ -42,6 +43,11 @@ public partial class IdeWindow : Control
|
||||
// PrintOrphanNodes();
|
||||
}
|
||||
|
||||
private void OnFocusExited()
|
||||
{
|
||||
_ = Task.GodotRun(async () => await Singletons.FileManager.SaveAllOpenFilesAsync());
|
||||
}
|
||||
|
||||
public void PickSolution(bool fullscreen = false)
|
||||
{
|
||||
if (_slnPicker is not null) throw new InvalidOperationException("Solution picker is already active");
|
||||
|
||||
Reference in New Issue
Block a user