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 #ifdef _WIN32
// Why doesn't the "else" method below work in windows when called from // Why doesn't the "else" method below work in windows when called from
// Host_RendererHasFocus()? // Host_RendererHasFocus()?
bRendererHasFocus = m_RenderParent && (m_RenderParent == wxWindow::FindFocus()); if (m_RenderParent)
return bRendererHasFocus; if (m_RenderParent->GetParent()->GetHWND() == GetForegroundWindow())
return true;
return false;
#else #else
return m_RenderParent && (m_RenderParent == wxWindow::FindFocus()); return m_RenderParent && (m_RenderParent == wxWindow::FindFocus());
#endif #endif

View File

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

View File

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

View File

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

View File

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