fix(mac): prevent cursor warps from outside quartz event loop (if active)

This commit is contained in:
Luiz Sardinha 2026-04-29 23:50:21 +02:00 committed by Nick Bolton
parent c3ecd0b806
commit 44c5c15082

View file

@ -262,6 +262,14 @@ uint32_t OSXScreen::activeSides()
void OSXScreen::warpCursor(int32_t x, int32_t y) void OSXScreen::warpCursor(int32_t x, int32_t y)
{ {
if (m_eventTapRunLoop && CFRunLoopGetCurrent() != m_eventTapRunLoop) {
CFRunLoopPerformBlock(m_eventTapRunLoop, kCFRunLoopDefaultMode, ^{
warpCursor(x, y);
});
CFRunLoopWakeUp(m_eventTapRunLoop);
return;
}
// move cursor without generating events // move cursor without generating events
CGPoint pos; CGPoint pos;
pos.x = x; pos.x = x;