mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-23 08:54:12 +08:00
play nice with other (legacy) clipboard monitors
This commit is contained in:
parent
f7c2641d58
commit
ea8e8fe3ed
@ -174,7 +174,13 @@ namespace Host
|
||||
std::thread([]
|
||||
{
|
||||
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;
|
||||
}).detach();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user