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.
This commit is contained in:
parent
ee087f5953
commit
44307c9508
|
@ -23,6 +23,7 @@
|
||||||
// The host can be just a command line app that opens a window, or a full blown debugger
|
// The host can be just a command line app that opens a window, or a full blown debugger
|
||||||
// interface.
|
// interface.
|
||||||
|
|
||||||
|
bool Host_UIHasFocus();
|
||||||
bool Host_RendererHasFocus();
|
bool Host_RendererHasFocus();
|
||||||
void Host_ConnectWiimote(int wm_idx, bool connect);
|
void Host_ConnectWiimote(int wm_idx, bool connect);
|
||||||
void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height);
|
void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height);
|
||||||
|
|
|
@ -773,6 +773,19 @@ bool CFrame::RendererHasFocus()
|
||||||
return false;
|
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))
|
void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
|
||||||
{
|
{
|
||||||
// Show all platforms and regions if...
|
// Show all platforms and regions if...
|
||||||
|
|
|
@ -138,6 +138,7 @@ public:
|
||||||
void OnRenderParentClose(wxCloseEvent& event);
|
void OnRenderParentClose(wxCloseEvent& event);
|
||||||
void OnRenderParentMove(wxMoveEvent& event);
|
void OnRenderParentMove(wxMoveEvent& event);
|
||||||
bool RendererHasFocus();
|
bool RendererHasFocus();
|
||||||
|
bool UIHasFocus();
|
||||||
void DoFullscreen(bool bF);
|
void DoFullscreen(bool bF);
|
||||||
void ToggleDisplayMode (bool bFullscreen);
|
void ToggleDisplayMode (bool bFullscreen);
|
||||||
void UpdateWiiMenuChoice(wxMenuItem *WiiMenuItem=nullptr);
|
void UpdateWiiMenuChoice(wxMenuItem *WiiMenuItem=nullptr);
|
||||||
|
|
|
@ -678,6 +678,11 @@ void Host_SetWiiMoteConnectionState(int _State)
|
||||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Host_UIHasFocus()
|
||||||
|
{
|
||||||
|
return main_frame->UIHasFocus();
|
||||||
|
}
|
||||||
|
|
||||||
bool Host_RendererHasFocus()
|
bool Host_RendererHasFocus()
|
||||||
{
|
{
|
||||||
return main_frame->RendererHasFocus();
|
return main_frame->RendererHasFocus();
|
||||||
|
|
|
@ -98,6 +98,11 @@ void Host_SetStartupDebuggingParameters()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Host_UIHasFocus()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool Host_RendererHasFocus()
|
bool Host_RendererHasFocus()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -95,6 +95,11 @@ void Host_SetStartupDebuggingParameters()
|
||||||
StartUp.bBootToPause = false;
|
StartUp.bBootToPause = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Host_UIHasFocus()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool Host_RendererHasFocus()
|
bool Host_RendererHasFocus()
|
||||||
{
|
{
|
||||||
return rendererHasFocus;
|
return rendererHasFocus;
|
||||||
|
|
|
@ -84,7 +84,7 @@ bool Device::Control::InputGateOn()
|
||||||
{
|
{
|
||||||
if (SConfig::GetInstance().m_BackgroundInput)
|
if (SConfig::GetInstance().m_BackgroundInput)
|
||||||
return true;
|
return true;
|
||||||
else if (Host_RendererHasFocus())
|
else if (Host_RendererHasFocus() || Host_UIHasFocus())
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue