diff options
| author | skidau <skidau@gmail.com> | 2015-02-04 18:05:22 +1100 |
|---|---|---|
| committer | skidau <skidau@gmail.com> | 2015-02-04 18:05:22 +1100 |
| commit | b9fb6ad3e8aa8ae1350d7dd4e9bd5cbec4e334ce (patch) | |
| tree | 231fbe7d1b3b51a8a235b876032905b1e2d5ec56 /Source/Core/DolphinWX/Frame.cpp | |
| parent | 5e645732f2fa39658db1c4a3017c54ed11c662be (diff) | |
Initialised all controller interfaces together on CFrame construction to fix the crash that would occur if the controller config were opened before a game was started.
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Frame.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 83ad8f8afc..e65747cc07 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -50,6 +50,8 @@ #include "Core/Movie.h" #include "Core/State.h" #include "Core/HW/DVDInterface.h" +#include "Core/HW/GCKeyboard.h" +#include "Core/HW/GCPad.h" #include "DolphinWX/Frame.h" #include "DolphinWX/GameListCtrl.h" @@ -345,15 +347,19 @@ END_EVENT_TABLE() // Creation and close, quit functions -bool CFrame::InitHotkeys() +bool CFrame::InitControllers() { if (!g_controller_interface.IsInit()) { #if defined(HAVE_X11) && HAVE_X11 Window win = X11Utils::XWindowFromHandle(GetHandle()); HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(win)); + Pad::Initialize(reinterpret_cast<void*>(win)); + Keyboard::Initialize(reinterpret_cast<void*>(win)); #else HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(GetHandle())); + Pad::Initialize(reinterpret_cast<void*>(GetHandle())); + Keyboard::Initialize(reinterpret_cast<void*>(GetHandle())); #endif return true; } @@ -497,7 +503,7 @@ CFrame::CFrame(wxFrame* parent, g_pCodeWindow->UpdateButtonStates(); // check if game is running - m_bHotkeysInit = InitHotkeys(); + m_bHotkeysInit = InitControllers(); m_poll_hotkey_timer = new wxTimer(this); Bind(wxEVT_TIMER, &CFrame::PollHotkeys, this); @@ -511,6 +517,9 @@ CFrame::~CFrame() if (m_bHotkeysInit) { HotkeyManagerEmu::Shutdown(); + Keyboard::Shutdown(); + Pad::Shutdown(); + m_bHotkeysInit = false; } drives.clear(); @@ -1261,7 +1270,7 @@ void CFrame::PollHotkeys(wxTimerEvent& event) { if (Core::GetState() == Core::CORE_UNINITIALIZED || Core::GetState() == Core::CORE_PAUSE) { - InitHotkeys(); + m_bHotkeysInit = InitControllers(); g_controller_interface.UpdateInput(); } |
