Skip to content

Commit

Permalink
Merge pull request #11739 from OatmealDome/iokit-be-gone
Browse files Browse the repository at this point in the history
InputCommon: Remove OSX (IOKit) input backend
  • Loading branch information
AdmiralCurtiss committed May 19, 2023
2 parents 279fcaf + 72d08f6 commit 50fe493
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 731 deletions.
6 changes: 0 additions & 6 deletions Source/Core/InputCommon/CMakeLists.txt
Expand Up @@ -107,11 +107,6 @@ if(WIN32)
)
elseif(APPLE)
target_sources(inputcommon PRIVATE
ControllerInterface/OSX/OSX.h
ControllerInterface/OSX/OSX.mm
ControllerInterface/OSX/OSXJoystick.h
ControllerInterface/OSX/OSXJoystick.mm
ControllerInterface/OSX/RunLoopStopper.h
ControllerInterface/Quartz/Quartz.h
ControllerInterface/Quartz/Quartz.mm
ControllerInterface/Quartz/QuartzKeyboardAndMouse.h
Expand All @@ -124,7 +119,6 @@ elseif(APPLE)
${CARBON_LIBRARY}
${COCOA_LIBRARY}
${FORCEFEEDBACK_LIBRARY}
${IOK_LIBRARY}
)
target_compile_options(inputcommon PRIVATE
-fobjc-arc
Expand Down
Expand Up @@ -16,7 +16,6 @@
#include "InputCommon/ControllerInterface/Xlib/XInput2.h"
#endif
#ifdef CIFACE_USE_OSX
#include "InputCommon/ControllerInterface/OSX/OSX.h"
#include "InputCommon/ControllerInterface/Quartz/Quartz.h"
#endif
#ifdef CIFACE_USE_SDL
Expand Down Expand Up @@ -64,7 +63,7 @@ void ControllerInterface::Initialize(const WindowSystemInfo& wsi)
// nothing needed
#endif
#ifdef CIFACE_USE_OSX
// nothing needed for OSX and Quartz
// nothing needed for Quartz
#endif
#ifdef CIFACE_USE_SDL
m_input_backends.emplace_back(ciface::SDL::CreateInputBackend(this));
Expand Down Expand Up @@ -120,18 +119,6 @@ void ControllerInterface::RefreshDevices(RefreshReason reason)
if (!m_is_init)
return;

#ifdef CIFACE_USE_OSX
if (m_wsi.type == WindowSystemType::MacOS)
{
std::lock_guard lk_pre_population(m_pre_population_mutex);
// This is needed to stop its threads before locking our mutexes, to avoid deadlocks
// (in case it tried to add a device after we had locked m_devices_population_mutex).
// There doesn't seem to be an easy to way to repopulate OSX devices without restarting its
// hotplug thread. This should not remove its devices, and if it did, calls should be ignored.
ciface::OSX::DeInit();
}
#endif

// We lock m_devices_population_mutex here to make everything simpler.
// Multiple devices classes have their own "hotplug" thread, and can add/remove devices at any
// time, while actual writes to "m_devices" are safe, the order in which they happen is not. That
Expand Down Expand Up @@ -180,10 +167,6 @@ void ControllerInterface::RefreshDevices(RefreshReason reason)
#ifdef CIFACE_USE_OSX
if (m_wsi.type == WindowSystemType::MacOS)
{
{
std::lock_guard lk_pre_population(m_pre_population_mutex);
ciface::OSX::Init();
}
ciface::Quartz::PopulateDevices(m_wsi.render_window);
}
#endif
Expand Down Expand Up @@ -239,7 +222,6 @@ void ControllerInterface::Shutdown()
// nothing needed
#endif
#ifdef CIFACE_USE_OSX
ciface::OSX::DeInit();
ciface::Quartz::DeInit();
#endif
#ifdef CIFACE_USE_ANDROID
Expand Down
12 changes: 0 additions & 12 deletions Source/Core/InputCommon/ControllerInterface/OSX/OSX.h

This file was deleted.

222 changes: 0 additions & 222 deletions Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm

This file was deleted.

0 comments on commit 50fe493

Please sign in to comment.