mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
InputCommon:QuarzKB&M: Use KVO to watch window position
CGWindowListCreateDescriptionFromArray would block for up to ~1ms, which isn't a great thing to do on the main emulation thread
This commit is contained in:
@ -8,6 +8,12 @@
|
||||
#include "Common/Matrix.h"
|
||||
#include "InputCommon/ControllerInterface/CoreDevice.h"
|
||||
|
||||
#ifdef __OBJC__
|
||||
@class DolWindowPositionObserver;
|
||||
#else
|
||||
class DolWindowPositionObserver;
|
||||
#endif
|
||||
|
||||
namespace ciface::Quartz
|
||||
{
|
||||
std::string KeycodeToName(const CGKeyCode keycode);
|
||||
@ -59,13 +65,16 @@ public:
|
||||
void UpdateInput() override;
|
||||
|
||||
explicit KeyboardAndMouse(void* view);
|
||||
~KeyboardAndMouse() override;
|
||||
|
||||
std::string GetName() const override;
|
||||
std::string GetSource() const override;
|
||||
|
||||
private:
|
||||
void MainThreadInitialization(void* view);
|
||||
|
||||
Common::Vec2 m_cursor;
|
||||
|
||||
uint32_t m_windowid;
|
||||
DolWindowPositionObserver* m_window_pos_observer;
|
||||
};
|
||||
} // namespace ciface::Quartz
|
||||
|
Reference in New Issue
Block a user