Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/LogExpert/Config/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ private Settings LoadOrCreateNew(FileSystemInfo fileInfo)
settings.preferences.maximumFilterEntries = 30;
}

SetBoundsWithinVirtualScreen(settings);

ConvertSettings(settings);

return settings;
Expand Down Expand Up @@ -444,6 +446,17 @@ private static List<T> ReplaceOrKeepExisting<T>(ExportImportFlags flags, List<T>
return newList;
}

// Checking if the appBounds values are outside the current virtual screen.
// If so, the appBounds values are set to 0.
private void SetBoundsWithinVirtualScreen(Settings settings)
{
var vs = SystemInformation.VirtualScreen;
if (vs.X + vs.Width < settings.appBounds.X + settings.appBounds.Width ||
vs.Y + vs.Height < settings.appBounds.Y + settings.appBounds.Height)
{
settings.appBounds = new Rectangle();
}
}
#endregion

protected void OnConfigChanged(SettingsFlags flags)
Expand Down