Skip to content

Commit

Permalink
Recalculate menu visibility predicates before the context menu is shown
Browse files Browse the repository at this point in the history
  • Loading branch information
crsib committed Sep 25, 2023
1 parent 12bbd5c commit 0639ebf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tracks/ui/CommonTrackPanelCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ unsigned CommonTrackPanelCell::DoContextMenu( const wxRect &rect,
if (items.empty())
return RefreshCode::RefreshNone;

auto& menuManager = MenuManager::Get(*pProject);
menuManager.UpdateMenus();

// Set up command context with extras
CommandContext context{ *pProject };
SelectedRegion region;
Expand All @@ -62,7 +65,7 @@ unsigned CommonTrackPanelCell::DoContextMenu( const wxRect &rect,
context.temporarySelection.pTrack = FindTrack().get();

auto &commandManager = CommandManager::Get(*pProject);
auto flags = MenuManager::Get( *pProject ).GetUpdateFlags();
auto flags = menuManager.GetUpdateFlags();

// Common dispatcher for the menu items
auto dispatcher = [&]( wxCommandEvent &evt ){
Expand Down

0 comments on commit 0639ebf

Please sign in to comment.