summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Frame.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-07-15 12:11:17 -0400
committerLioncash <mathew1800@gmail.com>2014-07-15 12:11:17 -0400
commitebd029973a730d6a6d6653621a2565fbdc38e49d (patch)
treed438e3232afcfb8b31f9324d87df7ebab759db29 /Source/Core/DolphinWX/Frame.cpp
parent01cd90deef0ebeb1b8960dbdb2952d143f34a60a (diff)
parentff918df88991710d58d983aa2e5dbcf03f2064ab (diff)
Merge pull request #604 from magcius/wip/emu-cleanup-2
Start cleaning up the input interface
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
-rw-r--r--Source/Core/DolphinWX/Frame.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp
index d0f379b78a..12fcb5f3bf 100644
--- a/Source/Core/DolphinWX/Frame.cpp
+++ b/Source/Core/DolphinWX/Frame.cpp
@@ -753,24 +753,15 @@ void CFrame::OnRenderWindowSizeRequest(int width, int height)
bool CFrame::RendererHasFocus()
{
- 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;
+ // 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);
}
void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))