mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-05 19:29:54 +08:00
Sent clipboard on a thread #4601
This commit is contained in:
@@ -79,7 +79,8 @@ Client::Client(
|
||||
m_writeToDropDirThread(NULL),
|
||||
m_socket(NULL),
|
||||
m_useSecureNetwork(false),
|
||||
m_args(args)
|
||||
m_args(args),
|
||||
m_sendClipboardThread(NULL)
|
||||
{
|
||||
assert(m_socketFactory != NULL);
|
||||
assert(m_screen != NULL);
|
||||
@@ -265,12 +266,11 @@ Client::leave()
|
||||
|
||||
m_active = false;
|
||||
|
||||
// send clipboards that we own and that have changed
|
||||
for (ClipboardID id = 0; id < kClipboardEnd; ++id) {
|
||||
if (m_ownClipboard[id]) {
|
||||
sendClipboard(id);
|
||||
}
|
||||
}
|
||||
m_sendClipboardThread = new Thread(
|
||||
new TMethodJob<Client>(
|
||||
this,
|
||||
&Client::sendClipboardThread,
|
||||
NULL));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -750,6 +750,17 @@ Client::onFileRecieveCompleted()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::sendClipboardThread(void*)
|
||||
{
|
||||
// send clipboards that we own and that have changed
|
||||
for (ClipboardID id = 0; id < kClipboardEnd; ++id) {
|
||||
if (m_ownClipboard[id]) {
|
||||
sendClipboard(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::handleStopRetry(const Event&, void*)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user