From 6ec51f6a6970e3b282187dc88cde4057c90403b1 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 25 Feb 2024 15:45:34 +0000 Subject: [PATCH] Revert IsAttached() fix as it doesn't handle hotkeys from the main menubar. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17101 --- common/tool/action_menu.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/common/tool/action_menu.cpp b/common/tool/action_menu.cpp index b1625f0afd..51abdf5a39 100644 --- a/common/tool/action_menu.cpp +++ b/common/tool/action_menu.cpp @@ -546,11 +546,10 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent ) { evt->SetMousePosition( g_menu_open_position ); } - // Check if it is a menubar event, and don't get any position if it is. - // The original hack is to see if g_last_menu_highlighted_id matches to see if it's a menubar menu event - // IsAttached() checks to see if a menubar was attached to the menu by wx, and if there is one, then the event - // is from a menubar menu. - else if( IsAttached() || ( g_last_menu_highlighted_id == aEvent.GetId() ) ) + // Check if it is a menubar event, and don't get any position if it is. Note that we + // can't use IsAttached() here, as it only differentiates a context menu, and we also + // want a hotkey to generate a position. + else if( g_last_menu_highlighted_id == aEvent.GetId() ) { evt->SetHasPosition( false ); }