Remove obsolete sanity check to improve performance significantly e.g. when search starts

This commit is contained in:
Peter Kirmeier 2023-08-13 22:26:01 +02:00
parent 8c62122c7e
commit b377c1aaf6

View file

@ -284,10 +284,7 @@ namespace SystemTrayMenu.DataClasses
internal void OpenSubMenu()
{
// TODO: always true? maybe only when cached in WaitToLoadMenu or keyboardInput?
if (((List<RowData>?)Owner?.GetDataGridView().Items.SourceCollection)?.Contains(this) ?? false)
{
Menu? openSubMenu = Owner.SubMenu;
Menu? openSubMenu = Owner?.SubMenu;
// only re-open when the menu is not already open
if (SubMenu != null && SubMenu == openSubMenu)
@ -307,16 +304,15 @@ namespace SystemTrayMenu.DataClasses
{
// Give the opening window focus
// if closing window lose focus, no window would have focus any more
Owner.Activate();
Owner.FocusTextBox();
Owner?.Activate();
Owner?.FocusTextBox();
openSubMenu.HideWithFade(true);
Owner.RefreshSelection();
Owner?.RefreshSelection();
}
if (IsPointingToFolder)
{
Owner.RiseStartLoadSubMenu(this);
}
Owner?.RiseStartLoadSubMenu(this);
}
}
}