Fix focus bug when using render to main window feature

This commit is contained in:
JDV 2016-07-18 19:55:09 -06:00
parent a6905d1641
commit 26068c6cb9
1 changed files with 10 additions and 1 deletions

View File

@ -1049,7 +1049,16 @@ void CFrame::StartGame(const std::string& filename)
SetThreadExecutionState(ES_CONTINUOUS | shouldScreenSave | ES_SYSTEM_REQUIRED);
#endif
m_RenderParent->SetFocus();
// We need this specifically to support setting the focus properly when using
// the 'render to main window' feature on Windows
if (auto panel = wxDynamicCast(m_RenderParent, wxPanel))
{
panel->SetFocusIgnoringChildren();
}
else
{
m_RenderParent->SetFocus();
}
wxTheApp->Bind(wxEVT_KEY_DOWN, &CFrame::OnKeyDown, this);
wxTheApp->Bind(wxEVT_RIGHT_DOWN, &CFrame::OnMouse, this);