mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-12 10:28:08 +00:00
[client] stop the cursorThread if video feed is disabled
The cursorThread prevents the host from going to sleep when the video feed is disabled as it's subscribed to the cursor queue. Stopping the cursorThread will unsubscribe from the queue and allow the host application to disable capture.
This commit is contained in:
@@ -290,6 +290,30 @@ bool core_isValidPointerPos(int x, int y)
|
||||
return g_state.ds->isValidPointerPos(x, y);
|
||||
}
|
||||
|
||||
bool core_startCursorThread(void)
|
||||
{
|
||||
if (g_state.cursorThread)
|
||||
return true;
|
||||
|
||||
g_state.stopVideo = false;
|
||||
if (!lgCreateThread("cursorThread", main_cursorThread, NULL,
|
||||
&g_state.cursorThread))
|
||||
{
|
||||
DEBUG_ERROR("cursor create thread failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void core_stopCursorThread(void)
|
||||
{
|
||||
g_state.stopVideo = true;
|
||||
if (g_state.cursorThread)
|
||||
lgJoinThread(g_state.cursorThread, NULL);
|
||||
|
||||
g_state.cursorThread = NULL;
|
||||
}
|
||||
|
||||
bool core_startFrameThread(void)
|
||||
{
|
||||
if (g_state.frameThread)
|
||||
|
Reference in New Issue
Block a user