Skip to content

Commit

Permalink
Fix for right-click menu
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Dec 18, 2023
1 parent 01409f3 commit 4f8cfdb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Source/Dialogs/Dialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,8 @@ void Dialogs::showCanvasRightClickMenu(Canvas* cnv, Component* originalComponent
addAndMakeVisible(button);
auto id = commandIds.removeAndReturn(0);

button->onClick = [editor, id]() {
editor->grabKeyboardFocus();
ApplicationCommandTarget::InvocationInfo info(id);
info.invocationMethod = ApplicationCommandTarget::InvocationInfo::fromMenu;
editor->commandManager.invoke(info, true);
};

button->setCommandToTrigger(&editor->commandManager, id, false);

if (auto* registeredInfo = editor->commandManager.getCommandForID(id)) {
ApplicationCommandInfo info(*registeredInfo);
editor->commandManager.getTargetForCommand(id, info);
Expand Down

0 comments on commit 4f8cfdb

Please sign in to comment.