Hopefully fixed "RendererHasFocus()" on windows. Input should work again.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5359 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak 2010-04-13 20:02:48 +00:00
parent 578828a142
commit 387aba7a6c
5 changed files with 9 additions and 25 deletions

View File

@ -757,8 +757,10 @@ bool CFrame::RendererHasFocus()
#ifdef _WIN32
// Why doesn't the "else" method below work in windows when called from
// Host_RendererHasFocus()?
bRendererHasFocus = m_RenderParent && (m_RenderParent == wxWindow::FindFocus());
return bRendererHasFocus;
if (m_RenderParent)
if (m_RenderParent->GetParent()->GetHWND() == GetForegroundWindow())
return true;
return false;
#else
return m_RenderParent && (m_RenderParent == wxWindow::FindFocus());
#endif

View File

@ -103,9 +103,6 @@ class CFrame : public wxFrame
void DoPause();
void DoStop();
bool bRenderToMain;
#ifdef _WIN32
bool bRendererHasFocus;
#endif
bool bNoWiimoteMsg;
void UpdateGUI();
void ToggleLogWindow(bool, int i = -1);

View File

@ -677,9 +677,5 @@ void Host_SetWiiMoteConnectionState(int _State)
bool Host_RendererHasFocus()
{
#ifdef _WIN32
return main_frame->bRendererHasFocus;
#else
return main_frame->RendererHasFocus();
#endif
}

View File

@ -1,5 +1,4 @@
#include <math.h>
#include "Common.h"
#include "pluginspecs_pad.h"
@ -28,7 +27,7 @@
#endif
#endif
// the plugin
// plugin globals
Plugin g_plugin( "GCPadNew", "Pad", "GCPad" );
SPADInitialize *g_PADInitialize = NULL;

View File

@ -1,5 +1,4 @@
#include <math.h>
#include "Common.h"
#include "pluginspecs_wiimote.h"
@ -13,7 +12,6 @@
#if defined(HAVE_X11) && HAVE_X11
#include <X11/Xlib.h>
Display* GCdisplay;
#endif
#define PLUGIN_VERSION 0x0100
@ -29,6 +27,10 @@ Display* GCdisplay;
#endif
#endif
// plugin globals
Plugin g_plugin( "WiimoteNew", "Wiimote", "Wiimote" );
SWiimoteInitialize g_WiimoteInitialize;
#ifdef _WIN32
class wxDLLApp : public wxApp
{
@ -40,15 +42,6 @@ class wxDLLApp : public wxApp
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
#endif
// copied from GCPad
SWiimoteInitialize g_WiimoteInitialize;
// Check if Dolphin is in focus
// ----------------
bool IsFocus()
{
// TODO: this
return true;
}
// copied from GCPad
HINSTANCE g_hInstance;
@ -70,9 +63,6 @@ wxWindow* GetParentedWxWindow(HWND Parent)
#endif
// /
// the plugin
Plugin g_plugin( "WiimoteNew", "Wiimote", "Wiimote" );
#ifdef _WIN32
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{