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