diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index 1bb48300bd..75e016687e 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -1256,3 +1256,17 @@ void EDA_BASE_FRAME::onSystemColorChange( wxSysColourChangedEvent& aEvent ) // Skip the change event to ensure the rest of the window controls get it aEvent.Skip(); } + + +#ifdef __WXWINDOWS__ +WXLRESULT EDA_BASE_FRAME::MSWWindowProc( WXUINT message, WXWPARAM wParam, WXLPARAM lParam ) +{ + // This will help avoid the menu keeping focus when the alt key is released + // You can still trigger accelerators as long as you hold down alt + if( message == WM_SYSCOMMAND ) + if( wParam == SC_KEYMENU && ( lParam >> 16 ) <= 0 ) + return 0; + + return wxFrame::MSWWindowProc( message, wParam, lParam ); +} +#endif \ No newline at end of file diff --git a/include/eda_base_frame.h b/include/eda_base_frame.h index d861b4f079..5cd667136f 100644 --- a/include/eda_base_frame.h +++ b/include/eda_base_frame.h @@ -682,7 +682,14 @@ private: */ virtual bool IsModal() const { return false; } -protected: +#ifdef __WXWINDOWS__ + /** + * Windows specific override of the wxWidgets message handler for a window + */ + WXLRESULT MSWWindowProc( WXUINT message, WXWPARAM wParam, WXLPARAM lParam ) override; +#endif + + protected: FRAME_T m_ident; // Id Type (pcb, schematic, library..) wxPoint m_framePos; wxSize m_frameSize;