From 26068c6cb9d29ca882957b8ec281e1af36cb7831 Mon Sep 17 00:00:00 2001 From: JDV Date: Mon, 18 Jul 2016 19:55:09 -0600 Subject: [PATCH] Fix focus bug when using render to main window feature --- Source/Core/DolphinWX/FrameTools.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 4dc8789796..c619190cda 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -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);