summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2015-06-08 13:43:39 +1200
committerMatthew Parlane <parlane@gmail.com>2015-06-08 13:43:39 +1200
commit9e1aab663f2afdd61bda773764cc3c8f652659aa (patch)
tree1a7290487da53e934f0fe5096075f195b285a012 /Source
parent5c7caf1f22685430f98f39b86b07cadee3171f68 (diff)
Revert "SDL: handle SDL_QUIT event"
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Common/Common.h1
-rw-r--r--Source/Core/DolphinWX/Frame.cpp4
-rw-r--r--Source/Core/DolphinWX/MainNoGUI.cpp2
-rw-r--r--Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp5
-rw-r--r--Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp20
-rw-r--r--Source/Core/InputCommon/ControllerInterface/SDL/SDL.h3
6 files changed, 9 insertions, 26 deletions
diff --git a/Source/Core/Common/Common.h b/Source/Core/Common/Common.h
index 960e5a96d8..8027e31878 100644
--- a/Source/Core/Common/Common.h
+++ b/Source/Core/Common/Common.h
@@ -136,7 +136,6 @@ enum HOST_COMM
WM_USER_STOP = 10,
WM_USER_CREATE,
WM_USER_SETCURSOR,
- WM_USER_QUIT,
};
// Used for notification on emulation state
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp
index 46aa317d12..e541ace507 100644
--- a/Source/Core/DolphinWX/Frame.cpp
+++ b/Source/Core/DolphinWX/Frame.cpp
@@ -777,10 +777,6 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
case IDM_STOPPED:
OnStopped();
break;
-
- case WM_USER_QUIT:
- Close(true);
- break;
}
}
diff --git a/Source/Core/DolphinWX/MainNoGUI.cpp b/Source/Core/DolphinWX/MainNoGUI.cpp
index 313ad0b20f..9186742d46 100644
--- a/Source/Core/DolphinWX/MainNoGUI.cpp
+++ b/Source/Core/DolphinWX/MainNoGUI.cpp
@@ -49,7 +49,7 @@ void Host_RefreshDSPDebuggerWindow() {}
static Common::Event updateMainFrameEvent;
void Host_Message(int Id)
{
- if (Id == WM_USER_STOP || Id == WM_USER_QUIT)
+ if (Id == WM_USER_STOP)
running = false;
}
diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
index 2c87e77f01..6b8b11fd3a 100644
--- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
@@ -134,11 +134,6 @@ void ControllerInterface::Shutdown()
//
void ControllerInterface::UpdateInput()
{
-#ifdef CIFACE_USE_SDL
- // SDL currently also handles SIGINT and SIGTERM,
- // so make sure to update it even if there is no SDL device.
- ciface::SDL::UpdateInput();
-#endif
for (ciface::Core::Device* d : m_devices)
d->UpdateInput();
}
diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
index 6e60cf0f7a..6cdfa470cd 100644
--- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
@@ -7,7 +7,6 @@
#include <sstream>
#include "Common/StringUtil.h"
-#include "Core/Host.h"
#include "InputCommon/ControllerInterface/SDL/SDL.h"
#ifdef _WIN32
@@ -68,19 +67,6 @@ void Init( std::vector<Core::Device*>& devices )
}
}
-void UpdateInput()
-{
- // Using SDL_INIT_JOYSTICK implies SDL_INIT_EVENT which installs a signal handler for SIGINT and SIGTERM.
- // In the future, we will be able to prevent this from happening:
- // SDL_SetHint(SDL_HINT_NO_SIGNAL_HANDLERS, "1");
- // but this was added after SDL 2.0.3 and is scheduled to be included in 2.0.4.
- // Until then, handle SDL_QUIT events here and tell Dolphin to exit.
- if (SDL_QuitRequested())
- Host_Message(WM_USER_QUIT);
-
- SDL_JoystickUpdate();
-}
-
Joystick::Joystick(SDL_Joystick* const joystick, const int sdl_index, const unsigned int index)
: m_joystick(joystick)
, m_sdl_index(sdl_index)
@@ -297,6 +283,12 @@ void Joystick::LeftRightEffect::SetSDLHapticEffect(ControlState state)
}
#endif
+void Joystick::UpdateInput()
+{
+ // each joystick is doin this, o well
+ SDL_JoystickUpdate();
+}
+
std::string Joystick::GetName() const
{
return StripSpaces(GetJoystickName(m_sdl_index));
diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h
index 65082847a2..751f40e9f4 100644
--- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h
+++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h
@@ -25,7 +25,6 @@ namespace SDL
{
void Init( std::vector<Core::Device*>& devices );
-void UpdateInput();
class Joystick : public Core::Device
{
@@ -131,6 +130,8 @@ private:
#endif
public:
+ void UpdateInput() override;
+
Joystick(SDL_Joystick* const joystick, const int sdl_index, const unsigned int index);
~Joystick();