Browse Source

Bug 2062: Custom commands menu fail to open

https://winscp.net/tracker/2062

Source commit: a6599139c9ec4cc10d6bdd0ff062df45bf99c24c
Martin Prikryl 3 years ago
parent
commit
d125f3f0b8
1 changed files with 3 additions and 1 deletions
  1. 3 1
      source/forms/NonVisual.cpp

+ 3 - 1
source/forms/NonVisual.cpp

@@ -1104,7 +1104,9 @@ static void GiveItemPriority(TTBCustomItem * Item)
 {
   DebugAssert(Item->GetTopComponent() != NULL);
   TTBCustomToolbar * ToolbarComponent = dynamic_cast<TTBCustomToolbar *>(Item->GetTopComponent());
-  if (ToolbarComponent != NULL)
+  if ((ToolbarComponent != NULL) &&
+      // Only for top-level buttons on custom command toolbar, not for submenus of the custom commands menu in the main menu
+      (Item->Parent == ToolbarComponent->Items))
   {
     TTBItemViewer * Viewer = ToolbarComponent->View->Find(Item);
     ToolbarComponent->View->GivePriority(Viewer);