Prevent focus stealing in some Linux WMs

OnEnter events will only raise the windows within KiCad rather than
between applications

Fixes https://gitlab.com/kicad/code/kicad/issues/10809

(cherry picked from commit 110728af48)
This commit is contained in:
Seth Hillbrand 2022-05-12 11:05:06 -07:00
parent 38a7cb9731
commit 7128f6adf0
2 changed files with 3 additions and 3 deletions

View File

@ -452,7 +452,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
{
wxWindow* holderWindow = dynamic_cast<wxWindow*>( m_toolMgr->GetToolHolder() );
#if defined( _WIN32 )
#if defined( _WIN32 ) || defined( __WXGTK__ )
// Mouse events may trigger regardless of window status (windows feature)
// However we need to avoid focus fighting (especially modals)
if( holderWindow && KIPLATFORM::UI::IsWindowActive( holderWindow ) )

View File

@ -459,8 +459,8 @@ void WX_VIEW_CONTROLS::onEnter( wxMouseEvent& aEvent )
return;
}
#if defined( _WIN32 )
// Win32 transmits mouse move and wheel events to all controls below the mouse regardless
#if defined( _WIN32 ) || defined( __WXGTK__ )
// Win32 and some *nix WMs transmit mouse move and wheel events to all controls below the mouse regardless
// of focus. Forcing the focus here will cause the EDA FRAMES to immediately become the
// top level active window.
if( m_parentPanel->GetParent() != nullptr )