play nice with other (legacy) clipboard monitors
This commit is contained in:
parent
f7c2641d58
commit
ea8e8fe3ed
@ -174,7 +174,13 @@ namespace Host
|
|||||||
std::thread([]
|
std::thread([]
|
||||||
{
|
{
|
||||||
while (WaitForSingleObject(clipboardUpdate, INFINITE) == WAIT_OBJECT_0)
|
while (WaitForSingleObject(clipboardUpdate, INFINITE) == WAIT_OBJECT_0)
|
||||||
if (auto text = Util::GetClipboardText()) GetThread(clipboard).AddSentence(std::move(text.value()));
|
{
|
||||||
|
for (int retry = 0; retry < 3; ++retry) // retry loop in case something else is using the clipboard
|
||||||
|
{
|
||||||
|
Sleep(10);
|
||||||
|
if (auto text = Util::GetClipboardText()) GetThread(clipboard).AddSentence(std::move(text.value()));
|
||||||
|
}
|
||||||
|
}
|
||||||
throw;
|
throw;
|
||||||
}).detach();
|
}).detach();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user