From 6b3d01ead94cb74f5c147c0d9df3196ce04e9df7 Mon Sep 17 00:00:00 2001
From: Jeff Young <jeff@rokeby.ie>
Date: Wed, 19 Feb 2025 23:42:36 +0000
Subject: [PATCH] Load actions from frame's actionmanager, not from singleton.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19989
---
 common/dialogs/dialog_hotkey_list.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/common/dialogs/dialog_hotkey_list.cpp b/common/dialogs/dialog_hotkey_list.cpp
index 02f02b431e..1f9f841247 100644
--- a/common/dialogs/dialog_hotkey_list.cpp
+++ b/common/dialogs/dialog_hotkey_list.cpp
@@ -21,11 +21,13 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  */
 
+#include "kicad_manager_frame.h"
 #include <dialogs/dialog_hotkey_list.h>
 #include <kiface_base.h>
 #include <eda_base_frame.h>
 #include <panel_hotkeys_editor.h>
 #include <widgets/ui_common.h>
+#include <tool/tool_manager.h>
 
 #include <wx/sizer.h>
 #include <wx/button.h>
@@ -39,7 +41,15 @@ DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS( EDA_BASE_FRAME* aParent ):
 
     m_hk_list = new PANEL_HOTKEYS_EDITOR( aParent, this, true );
 
-    Kiway().GetActions( m_hk_list->ActionsList() );
+    wxWindow* kicadMgr_window = wxWindow::FindWindowByName( KICAD_MANAGER_FRAME_NAME );
+
+    if( KICAD_MANAGER_FRAME* kicadMgr = static_cast<KICAD_MANAGER_FRAME*>( kicadMgr_window ) )
+    {
+        ACTION_MANAGER* actionMgr = kicadMgr->GetToolManager()->GetActionManager();
+
+        for( const auto& [name, action] : actionMgr->GetActions() )
+            m_hk_list->ActionsList().push_back( action );
+    }
 
     kiface = Kiway().KiFACE( KIWAY::FACE_SCH );
     kiface->GetActions( m_hk_list->ActionsList() );