[idd] driver: fix loss of mouse cursor on guest wakeup
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run

This commit is contained in:
Geoffrey McRae 2025-03-29 01:16:53 +00:00
parent 530e83e7bf
commit 35c975d334

View File

@ -88,6 +88,8 @@ reInit:
} }
m_swapChain.reset(new CSwapChainProcessor(m_devContext, swapChain, m_dx11Device, m_dx12Device, newFrameEvent)); m_swapChain.reset(new CSwapChainProcessor(m_devContext, swapChain, m_dx11Device, m_dx12Device, newFrameEvent));
m_lastShapeId = 0;
m_thread.Attach(CreateThread(nullptr, 0, _CursorThread, this, 0, nullptr)); m_thread.Attach(CreateThread(nullptr, 0, _CursorThread, this, 0, nullptr));
} }
@ -111,21 +113,34 @@ DWORD CALLBACK CIndirectMonitorContext::_CursorThread(LPVOID arg)
void CIndirectMonitorContext::CursorThread() void CIndirectMonitorContext::CursorThread()
{ {
HRESULT hr = 0; HRESULT hr = 0;
bool running = true;
for (;;) while(running)
{ {
HANDLE waitHandles[] = HANDLE waitHandles[] =
{ {
m_cursorDataEvent.Get(), m_cursorDataEvent.Get(),
m_terminateEvent.Get() m_terminateEvent.Get()
}; };
DWORD waitResult = WaitForMultipleObjects(ARRAYSIZE(waitHandles), waitHandles, FALSE, 100);
if (waitResult == WAIT_TIMEOUT) DWORD waitResult = WaitForMultipleObjects(
continue; ARRAYSIZE(waitHandles), waitHandles, FALSE, 100);
else if (waitResult == WAIT_OBJECT_0 + 1)
break; switch (waitResult)
else if (waitResult != WAIT_OBJECT_0)
{ {
case WAIT_TIMEOUT:
continue;
// cursorDataEvent
case WAIT_OBJECT_0:
break;
// terminateEvent
case WAIT_OBJECT_0 + 1:
running = false;
continue;
default:
hr = HRESULT_FROM_WIN32(waitResult); hr = HRESULT_FROM_WIN32(waitResult);
DEBUG_ERROR_HR(hr, "WaitForMultipleObjects"); DEBUG_ERROR_HR(hr, "WaitForMultipleObjects");
return; return;