summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/FrameTools.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2015-03-05 19:49:10 +1100
committerskidau <skidau@gmail.com>2015-03-08 20:27:13 +1100
commit780eef68f6ec7deee1a11f8bc1386f70133b6cc0 (patch)
tree9817364bdf1ac1e9ff73de1029a07e45b32c8f5e /Source/Core/DolphinWX/FrameTools.cpp
parentb446ea013241fc28797f5bfdfdb40b374394baed (diff)
Fixed the crash that would occur when the Refresh button was pressed in the controllers config.
- Simplified the locking mechanism when controllers were updated - Reloaded the config of the controls instead of re-initialising the control plugins - Fixed controls being unresponsive after the Refresh button was pressed - Disables the hotkeys while the controller config is open
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index 7ab7e9523c..04534a48fb 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -51,6 +51,7 @@
#include "Core/State.h"
#include "Core/HW/CPU.h"
#include "Core/HW/DVDInterface.h"
+#include "Core/HW/GCKeyboard.h"
#include "Core/HW/GCPad.h"
#include "Core/HW/ProcessorInterface.h"
#include "Core/HW/SI_Device.h"
@@ -1366,27 +1367,31 @@ void CFrame::OnConfigHotkey(wxCommandEvent& WXUNUSED (event))
InputConfig* const hotkey_plugin = HotkeyManagerEmu::GetConfig();
// check if game is running
- if (g_controller_interface.IsInit())
- {
- was_init = true;
- }
- else
+ bool game_running = false;
+ if (Core::GetState() == Core::CORE_RUN)
{
-#if defined(HAVE_X11) && HAVE_X11
- Window win = X11Utils::XWindowFromHandle(GetHandle());
- HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(win));
-#else
- HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(GetHandle()));
-#endif
+ Core::SetState(Core::CORE_PAUSE);
+ game_running = true;
}
+ HotkeyManagerEmu::Enable(false);
+
InputConfigDialog m_ConfigFrame(this, *hotkey_plugin, _("Dolphin Hotkeys"));
m_ConfigFrame.ShowModal();
+ // Update references in case controllers were refreshed
+ if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
+ Wiimote::LoadConfig();
+ Keyboard::LoadConfig();
+ Pad::LoadConfig();
+ HotkeyManagerEmu::LoadConfig();
+
+ HotkeyManagerEmu::Enable(true);
+
// if game isn't running
- if (!was_init)
+ if (game_running)
{
- HotkeyManagerEmu::Shutdown();
+ Core::SetState(Core::CORE_RUN);
}
// Update the GUI in case menu accelerators were changed