summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/FrameTools.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2015-04-16 12:33:20 +1000
committerskidau <skidau@gmail.com>2015-04-16 12:33:20 +1000
commitf0593095b412dbeb81122f6894ab2f259fa413b8 (patch)
tree971589b86c1234844adbc90d8a21daaeffa99130 /Source/Core/DolphinWX/FrameTools.cpp
parent70605cae5cf3662927ac1f5798ba7e51bfa84fb8 (diff)
parentba664b3293e88ddee94a4b922ced192f3270b569 (diff)
Merge pull request #2295 from comex/fix-usb-threading
Fix threading issues
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index de41814259..4edb08980f 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -1584,17 +1584,21 @@ void CFrame::ConnectWiimote(int wm_idx, bool connect)
{
if (Core::IsRunning() && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
{
+ bool was_unpaused = Core::PauseAndLock(true);
GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect);
wxString msg(wxString::Format(_("Wiimote %i %s"), wm_idx + 1,
connect ? _("Connected") : _("Disconnected")));
Core::DisplayMessage(WxStrToStr(msg), 3000);
Host_UpdateMainFrame();
+ Core::PauseAndLock(false, was_unpaused);
}
}
void CFrame::OnConnectWiimote(wxCommandEvent& event)
{
+ bool was_unpaused = Core::PauseAndLock(true);
ConnectWiimote(event.GetId() - IDM_CONNECT_WIIMOTE1, !GetUsbPointer()->AccessWiiMote((event.GetId() - IDM_CONNECT_WIIMOTE1) | 0x100)->IsConnected());
+ Core::PauseAndLock(false, was_unpaused);
}
// Toggle fullscreen. In Windows the fullscreen mode is accomplished by expanding the m_Panel to cover
@@ -1792,6 +1796,7 @@ void CFrame::UpdateGUI()
GetMenuBar()->FindItem(IDM_CONNECT_BALANCEBOARD)->Enable(RunningWii);
if (RunningWii)
{
+ bool was_unpaused = Core::PauseAndLock(true);
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE1)->Check(GetUsbPointer()->
AccessWiiMote(0x0100)->IsConnected());
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE2)->Check(GetUsbPointer()->
@@ -1802,6 +1807,7 @@ void CFrame::UpdateGUI()
AccessWiiMote(0x0103)->IsConnected());
GetMenuBar()->FindItem(IDM_CONNECT_BALANCEBOARD)->Check(GetUsbPointer()->
AccessWiiMote(0x0104)->IsConnected());
+ Core::PauseAndLock(false, was_unpaused);
}
if (m_ToolBar)