summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Frame.cpp
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-07-16 10:24:40 -0400
committerJasper St. Pierre <jstpierre@mecheye.net>2014-07-16 10:27:21 -0400
commit44307c950888a4942a35b0176e2601c266894983 (patch)
tree210fd55431646879e19e5653d69e901c2a5cfdad /Source/Core/DolphinWX/Frame.cpp
parentee087f595343ff258ef7a85eea2b59b5ba2790e3 (diff)
Host: Add a new "UIHasFocus" hook to determine if the UI has focus
We can't use RendererHasFocus for this purpose because of some issues with exclusive fullscreen, and the new RendererHasFocus implementation didn't work for non-Render to Main Window cases, since the renderer window wasn't managed by wx.
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
-rw-r--r--Source/Core/DolphinWX/Frame.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp
index d0f379b78a..b57f18ad69 100644
--- a/Source/Core/DolphinWX/Frame.cpp
+++ b/Source/Core/DolphinWX/Frame.cpp
@@ -773,6 +773,19 @@ bool CFrame::RendererHasFocus()
return false;
}
+bool CFrame::UIHasFocus()
+{
+ // UIHasFocus should return true any time any one of our UI
+ // 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))
{
// Show all platforms and regions if...