diff options
| author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-07-16 10:21:22 -0400 |
|---|---|---|
| committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-07-16 10:26:06 -0400 |
| commit | ee087f595343ff258ef7a85eea2b59b5ba2790e3 (patch) | |
| tree | 568d1edf92d5d47b0098f62f3e661c1cd996931d /Source | |
| parent | 6937f7cbde6b2fa64b3c4b56e1acfcd90de4c632 (diff) | |
Revert "Frame: Fix RendererHasFocus"
This reverts commit ff918df88991710d58d983aa2e5dbcf03f2064ab.
This changed it from "RendererHasFocus" to "UIHasFocus", which is
wrong. Specifically, it broke for non-Render to Main Window cases where
the renderer window isn't managed by wx. It also broke the pending
exclusive fullscreen support, which checks this function to determine if
the renderer is on top so it can full-screen it.
We'll add a new hook, "UIHasFocus", in the next commit.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinWX/Frame.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 12fcb5f3bf..d0f379b78a 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -753,15 +753,24 @@ void CFrame::OnRenderWindowSizeRequest(int width, int height) bool CFrame::RendererHasFocus() { - // RendererHasFocus should return true any time any one of our - // windows has the focus, including any dialogs or other windows. - // - // wxGetActiveWindow() returns the current wxWindow which has - // focus. If it's not one of our windows, then it will return - // null. - - wxWindow *focusWindow = wxGetActiveWindow(); - return (focusWindow != nullptr); + if (m_RenderParent == nullptr) + return false; +#ifdef _WIN32 + if (m_RenderParent->GetParent()->GetHWND() == GetForegroundWindow()) + return true; +#else + wxWindow *window = wxWindow::FindFocus(); + if (window == nullptr) + return false; + // Why these different cases? + if (m_RenderParent == window || + m_RenderParent == window->GetParent() || + m_RenderParent->GetParent() == window->GetParent()) + { + return true; + } +#endif + return false; } void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event)) |
